{{/* Hugo-Native Operation Renderer Renders a single API operation with parameters, request body, and responses. Styled to match docusaurus-openapi aesthetic. Params: - operation: Map with method, path, summary, operationId - spec: The full OpenAPI spec object - context: The page context for URL generation */}} {{ $operation := .operation }} {{ $spec := .spec }} {{ $method := lower $operation.method }} {{ $path := $operation.path }} {{ $operationId := $operation.operationId }} {{/* Find the operation definition in the spec */}} {{ $pathDef := index $spec.paths $path }} {{ $opDef := dict }} {{ if $pathDef }} {{ $opDef = index $pathDef $method | default dict }} {{ end }} {{/* Generate anchor ID matching Redocly operation/{operationId} format */}} {{ $anchorId := printf "operation/%s" $operationId }}
{{/* Operation Header */}}
{{ upper $method }} {{ $path }}

{{ $operation.summary }}

{{/* Operation Description */}} {{ with $opDef.description }}
{{ . | markdownify }}
{{ end }} {{/* Parameters Section */}} {{ $params := $opDef.parameters | default slice }} {{ if gt (len $params) 0 }} {{ partial "api/parameters.html" (dict "parameters" $params "spec" $spec) }} {{ end }} {{/* Request Body Section */}} {{ with $opDef.requestBody }} {{ partial "api/request-body.html" (dict "requestBody" . "spec" $spec) }} {{ end }} {{/* Code Sample Section */}} {{ partial "api/code-sample.html" (dict "opDef" $opDef "operation" $operation "spec" $spec "context" .context ) }} {{/* Responses Section */}} {{ with $opDef.responses }} {{ partial "api/responses.html" (dict "responses" . "spec" $spec) }} {{ end }}