Skip to content

Commit 50d778c

Browse files
authored
Do not debug-dump for top-level arrays & improve array rendering in OpenAPI responses (#427)
* Do not debug-dump for top-level arrays in OpenAPI responses * Render array without defined items, adjust item type rendering * Change from "array<type>" to "array of types"
1 parent 27e2448 commit 50d778c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

site/themes/arangodb-docs-theme/layouts/_default/_markup/render-codeblock-openapi.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,8 @@
122122
<ul class="openapi-table">
123123
<div class="openapi-table-title">Response Body</div>
124124
{{ range $k, $v := $content.content }}
125-
{{ if $v.schema.items }}
125+
{{ if eq $v.schema.type "array" }}
126126
{{ $required := false }}
127-
{{ $v }}
128127
{{- template "renderProperty" dict "title" $statusId "prop" "" "value" $v.schema "required" $required }}
129128
{{ else }}
130129
{{ range $prop, $value := $v.schema.properties}}
@@ -179,8 +178,8 @@
179178
{{ $type := $value.type }}
180179
{{ $anchor := printf "%s_%s" $title $prop }}
181180
<li class="openapi-table-row regular-font">
182-
{{ if eq $value.type "array" }}
183-
{{ $type = printf "[%s]" $value.items.type }}
181+
{{ if and (eq $value.type "array") ($value.items.type) }}
182+
{{ $type = printf "array of %ss" $value.items.type }}
184183
{{ else if eq $value.type "object" }}
185184
{{ $type = "object" }}
186185
{{ end }}

0 commit comments

Comments
 (0)