Break out non-JSON request/response content types as tables (#1756)

* Break out non-JSON request/response content types as tables

Currently we display this as a table like "image/png|image/jpeg" and description on a single line, but we're using a table. This breaks the join out to individual rows.

* changelog
This commit is contained in:
Travis Ralston 2024-03-21 14:45:07 -06:00 committed by GitHub
parent 6700f5ddd1
commit eb22fac5dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 18 additions and 14 deletions

View file

@ -53,12 +53,13 @@
{{/*
Show the content types and description.
*/}}
{{ $mimes := slice }}
{{ $mimes := slice }}
{{ $descriptions := slice }}
{{ range $mime, $body := $request_body.content }}
{{ $mimes = $mimes | append $mime }}
{{ $descriptions = $descriptions | append $request_body.description }}
{{ end }}
{{ $content_type := delimit $mimes "|"}}
{{ partial "openapi/render-content-type" (dict "content_type" $content_type "description" $request_body.description) }}
{{ partial "openapi/render-content-type" (dict "content_types" $mimes "descriptions" $descriptions) }}
{{ end }}
<h3>Request body example</h3>