{# Bengal OpenAPI Schema Page ========================== Standalone schema/model documentation page. Displays JSON Schema object structure with examples. Context: - element: DocElement with OpenAPISchemaMetadata - page: Page object - section: Section for navigation - site: Site instance - config: Config instance Kida Features: - {% with %} for nil-resilient optional sections - {% cache %} for expensive schema rendering - Optional chaining (?.) and null coalescing (??) #} {% extends 'autodoc/openapi/layouts/reference.html' %} {% let meta = element?.typed_metadata ?? element?.metadata ?? {} %} {% let schema_name = element?.name ?? page?.title ?? 'Schema' %} {% let schema_type = meta?.schema_type ?? 'object' %} {% let properties = meta?.properties ?? {} %} {% let required_props = meta?.required ?? () %} {% let enum_vals = meta?.enum %} {% let example_val = meta?.example %} {% let description = element?.description ?? '' %} {% block header %}

{{ schema_name }} {{ schema_type }}

{% if description %}
{{ description | markdownify | safe }}
{% end %} {% end %} {% block content_main %}
{# Schema Properties #} {% if properties | length > 0 %}

Properties

{% cache 'openapi-schema-' ~ schema_name %} {% let schema = meta %} {% let name = schema_name %} {% let depth = 0 %} {% include 'autodoc/openapi/partials/schema-viewer.html' %} {% end %}
{% end %} {# Enum Values (for enum types) #} {% with enum_vals as enums %} {% if enums | length > 0 %}

Allowed Values

{% for val in enums %} {{ val }} {% end %}
{% end %} {% end %} {# Example #} {% with example_val as example %}

Example

{{ example | tojson(indent=2) }}
{% end %} {# Usage Information #} {% with element?.see_also as refs %} {% if refs | length > 0 %}

Used In

{% end %} {% end %}
{% end %}