{{/* Hugo-Native Request Body Renderer Renders the request body section including schema properties. Params: - requestBody: OpenAPI requestBody object - spec: The full OpenAPI spec object for resolving $ref */}} {{ $requestBody := .requestBody }} {{ $spec := .spec }} {{ $required := $requestBody.required | default false }} {{ $description := $requestBody.description | default "" }} {{/* Get content schema - typically application/json */}} {{ $content := $requestBody.content | default dict }} {{ $jsonContent := index $content "application/json" | default dict }} {{ $schema := $jsonContent.schema | default dict }} {{/* Resolve $ref if present */}} {{ $resolvedSchema := $schema }} {{ if isset $schema "$ref" }} {{ $refPath := index $schema "$ref" }} {{/* Parse ref like "#/components/schemas/DistinctCacheCreateRequest" */}} {{ $refParts := split $refPath "/" }} {{ if ge (len $refParts) 4 }} {{ $schemaName := index $refParts 3 }} {{ with index $spec.components.schemas $schemaName }} {{ $resolvedSchema = . }} {{ end }} {{ end }} {{ end }}

Request body {{ if $required }} required {{ end }}

{{ if $description }}
{{ $description | markdownify }}
{{ end }} {{/* Content type indicator */}}
Content-Type: application/json
{{/* Render schema properties */}} {{ with $resolvedSchema }} {{ partial "api/schema.html" (dict "schema" . "spec" $spec "level" 0) }} {{ end }}