Skip to content

Commit

Permalink
Update layouts for anyOf in array
Browse files Browse the repository at this point in the history
Signed-off-by: Kévin Commaille <[email protected]>
  • Loading branch information
zecakeh committed Nov 11, 2022
1 parent 794a008 commit a0bc100
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions layouts/partials/json-schema/resolve-additional-types.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
{{/*
Add any nested objects referenced in this object's `items`
*/}}
{{ if reflect.IsSlice $this_object.items}}
{{ range $this_object.items }}
{{ if and $this_object.items $this_object.items.anyOf }}
{{ range $this_object.items.anyOf }}
{{ $additional_objects = partial "get-additional-objects" (dict "this_object" . "additional_objects" $additional_objects "anchor_base" $anchor_base) }}
{{ end }}
{{ else }}
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/openapi/render-responses.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ <h3>{{$code}} response</h3>
*/}}
{{ if eq $schema.type "array" }}
{{ $type_of := "" }}
{{ if reflect.IsSlice $schema.items }}
{{ if $schema.items.anyOf }}
{{ $types := slice }}
{{ range $schema.items }}
{{ range $schema.items.anyOf }}
{{ if .title }}
{{ $types = $types | append .title}}
{{ else }}
Expand Down

0 comments on commit a0bc100

Please sign in to comment.