{# Bengal OpenAPI Request Body =========================== Displays request body information including: - Content type badges - Description - Schema viewer (for object types) Context: - request_body: OpenAPIRequestBodyMetadata or dict with: - content_type: Media type (e.g., "application/json") - schema_ref: Reference to schema - required: bool - description: Description - schema: Inline schema object (optional) Kida Features: - {% with %} for nil-safe optional sections - {% spaceless %} for compact badge output - Optional chaining (?.) and null coalescing (??) #} {% let content_type = request_body?.content_type ?? 'application/json' %} {% let is_required = request_body?.required ?? false %} {% let description = request_body?.description ?? '' %} {% let schema_ref = request_body?.schema_ref %} {% let inline_schema = request_body?.schema %}

Request Body

{% spaceless %} {% if is_required %} required {% end %} {{ content_type }} {% end %}
{# Description #} {% if description %}
{{ description | markdownify | safe }}
{% end %} {# Schema Reference Link #} {% with schema_ref as ref %} {% let schema_name = ref | split('#/components/schemas/') | last %}
Schema: {{ schema_name }}
{% end %} {# Inline Schema Viewer #} {% with inline_schema as s %} {% let schema = s %} {% let depth = 0 %} {% include 'autodoc/openapi/partials/schema-viewer.html' %} {% end %}