Do not add empty arrays to examples (#1849)

This commit is contained in:
Kévin Commaille 2024-06-11 18:03:53 +02:00 committed by GitHub
parent c4b4c896b7
commit acec09f567
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -35,9 +35,9 @@
*/}}
{{ if reflect.IsMap $this_object.items }}
{{ $items_example := partial "json-schema/resolve-example" $this_object.items }}
{{ $example = slice $items_example }}
{{ else }}
{{ $example = slice }}
{{ if $items_example }}
{{ $example = slice $items_example }}
{{ end }}
{{ end }}
{{ end }}