{{/* Render a table showing content types and their descriptions, given: * `content_types`: OpenAPI data specifying the content types as a dictionary of the form {string: {"schema": JsonSchema}} */}} {{ $content_types := .content_types }} {{ if (gt (len $content_types) 0) }} {{ range $mime, $body := $content_types }} {{ end }}
Content-Type Description
{{ $mime }} {{/* Force the rendering as a block so the description is always inside a paragraph. This allows to always keep the same spacing between paragraphs when adding added-in and changed-in paragraphs. */}} {{ $body.schema.description | page.RenderString (dict "display" "block") -}} {{ if (index $body.schema "x-addedInMatrixVersion") }}{{ partial "added-in" (dict "v" (index $body.schema "x-addedInMatrixVersion")) }}{{ end -}} {{ if (index $body.schema "x-changedInMatrixVersion") }}{{ partial "changed-in" (dict "changes_dict" (index $body.schema "x-changedInMatrixVersion")) }}{{ end -}}
{{ end }}