Add doc comments

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
Kévin Commaille 2025-03-04 20:15:21 +01:00
parent b83bc65850
commit 52a90f21df
No known key found for this signature in database
GPG key ID: 0C971D9DBC9D678D
2 changed files with 13 additions and 2 deletions

View file

@ -37,6 +37,11 @@
{{ end }}
{{ end }}
{{/*
Add the assembled example to the list if either (a) the example is
non-empty, or (b) the object itself is meant to be empty (so an
empty example is correct).
*/}}
{{ if (or $example (not $this_object.properties)) }}
{{ $examples = slice $example }}
{{ end }}

View file

@ -17,6 +17,11 @@
*/}}
{{/*
Request and response bodies can have several content types. If there is a
JSON type, we display that; otherwise we just show the content types and
descriptions.
*/}}
{{ $json_body := index .content "application/json" }}
{{ if $json_body }}
{{/*
@ -48,9 +53,10 @@
{{ end }}
{{/*
Render object tables for any objects referenced in the response.
Render object tables for any objects referenced in the request/response.
This will be a no-op for response types which aren't objects or arrays.
This will be a no-op for request/response body types which aren't
objects or arrays.
*/}}
{{ $additional_types := partial "json-schema/resolve-additional-types" (dict "schema" $schema "anchor_base" .anchor_base) }}
{{ range $additional_types }}