{# 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' %} {% from 'autodoc/openapi/_schema.html' import schema_viewer %} {% let schema = element | schema_view %} {% let schema_name = schema?.name ?? page?.title ?? 'Schema' %} {% let schema_type = schema?.schema_type ?? 'object' %} {% let properties = schema?.properties ?? {} %} {% let required_props = schema?.required ?? () %} {% let enum_vals = schema?.enum %} {% let example_val = schema?.example %} {% let description = schema?.description ?? element?.description ?? '' %} {% let schema_format = schema?.raw_schema?.format ?? '' %} {% let composition = schema?.display_schema | schema_composition %} {% let additional = schema?.display_schema | schema_additional_properties %} {% let flags = schema?.display_schema | schema_flags %} {# A schema has a renderable "body" when it has properties, is composed (oneOf/anyOf/allOf), or is an open/typed map (additionalProperties). #} {% let has_body = properties | length > 0 or composition is not none or additional is not none %} {% block api_left %} {% end %} {% block api_header %} Schema
{{ schema_name }}
{{ schema_type }}
{% if flags?.deprecated %}deprecated{% end %}
{{ schema_type }}
{{ schema_format }}
{{ clabel }}{% if cvalue %}: {{ cvalue }}{% end %}
{% end %}
{{ val }}
{% end %}
{{ example | tojson(indent=2) }}