Skip to content
This repository was archived by the owner on Jul 27, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 0 additions & 55 deletions .github/workflows/sonarcloud-maven.yml

This file was deleted.

8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- SnakeYAML version 2.4
- parent changed from fj-bom to fj-universe-tool 2.4.4

### Removed

- [workflow sonar cloud](.github/workflows/sonarcloud-maven.yml)

### Fixed

- fix for simple type array documentation <https://github.com/fugerit-org/yaml-doc-tool/issues/8>

## [1.0.2] - 2024-10-25

### Changed
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/free_marker_yaml/yaml-doc-macro.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<#if currentType = 'array' >
<#if currentFieldValue['items']['$ref']?? >
<#assign arrayType=currentFieldValue['items']['$ref']/>
<#elseif currentFieldValue['items']['type']??>
<#assign arrayType=currentFieldValue['items']['type']/>
</#if>
<#assign currentType>${currentType}[${arrayType!''}]</#assign>
</#if>
Expand Down
46 changes: 30 additions & 16 deletions src/test/resources/sample/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@ paths:
/sample/id/{id}:
get:
summary: Sample
parameters:
parameters:
- name: id
in: path
required: true
schema:
type: string
type: string
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/SampleResult'
$ref: '#/components/schemas/SampleResult'
components:
schemas:
SampleResult:
properties:
id:
id:
type: string
example: '1234'
description: 'Id of the sample'
sampleTest:
sampleTest:
type: string
example: 'Sample text'
description: 'Sample properties'
Expand All @@ -47,48 +47,62 @@ components:
$ref: '#/components/schemas/SampleLevelTwoE'
SampleLevelTwoA:
properties:
note:
note:
type: string
example: 'Level two notes A'
description: 'Level two description'
minLength: 1
maxLength: 5
count:
count:
type: number
example: 100
description: 'Level two count'
minimum: 0
maximum: 99999
SampleLevelTwoB:
properties:
note:
note:
type: string
example: 'Level two notes B'
description: 'Level two description'
SampleLevelTwoC:
properties:
note:
note:
type: string
example: 'Level two notes C'
description: 'Level two description'
SampleLevelTwoD:
properties:
note:
note:
type: string
example: 'Level two notes D'
description: 'Level two description'
SampleLevelTwoE:
properties:
note:
note:
type: string
example: 'Level two notes E'
description: 'Level two description'
SampleLevelTwoRef1:
$ref: '#/components/schemas/SampleLevelTwoE'
properties:
noteTest:
type: string
example: 'Level two notes Ref 1'
description: 'Level two description'
SampleLevelTwoRef2:
$ref: '#/components/schemas/SampleLevelTwoD'
SampleArrayString:
description: Sample with array properties
properties:
testList1:
description: Test list 1
type: array
items:
$ref: '#/components/schemas/SampleLevelTwoA'
testList2:
description: Test list 3
type: array
items:
type: string
description: Array of string
testList3:
description: Test list 3
type: array
items:
$ref: '#/components/schemas/SampleLevelTwoB'