{# Bengal OpenAPI Endpoint Page (Hero Template) ============================================= Full endpoint documentation with three-column explorer layout. The primary template for individual REST API endpoints. Context: - element: DocElement with OpenAPIEndpointMetadata - page: Page object - section: Section for navigation - site: Site instance - config: Config instance Kida Features: - {% match %} for HTTP method and status code styling - {% with %} for nil-resilient optional sections - {% cache %} for expensive response rendering - {% spaceless %} for compact badge output - Optional chaining (?.) and null coalescing (??) #} {% extends 'autodoc/openapi/layouts/explorer.html' %} {% let meta = element?.typed_metadata ?? element?.metadata ?? {} %} {% let http_method = meta?.method ?? 'GET' %} {% let endpoint_path = meta?.path ?? '/' %} {% let operation_id = meta?.operation_id %} {% let summary = meta?.summary ?? element?.description ?? '' %} {% let is_deprecated = meta?.deprecated ?? false %} {% let parameters = meta?.parameters ?? () %} {% let request_body = meta?.request_body %} {% let responses = meta?.responses ?? () %} {% let security = meta?.security ?? () %} {% let tags = meta?.tags ?? () %} {# Group parameters by location #} {% let path_params = parameters |> where('location', 'path') %} {% let query_params = parameters |> where('location', 'query') %} {% let header_params = parameters |> where('location', 'header') %} {% let cookie_params = parameters |> where('location', 'cookie') %} {% block header %} {# Playground Bar: Method + Path + Copy #} {% let method = http_method %} {% let path = endpoint_path %} {% let deprecated = is_deprecated %} {% include 'autodoc/openapi/partials/playground-bar.html' %} {# Endpoint Header #} {% include 'autodoc/openapi/partials/endpoint-header.html' %} {% end %} {% block content_main %}
{# Parameters Section #} {% if parameters | length > 0 %}

Parameters

{# Path Parameters #} {% if path_params | length > 0 %}

{{ icon('link', size=14) }} Path Parameters

{% for p in path_params %} {% let param = p %} {% include 'autodoc/openapi/partials/param-row.html' %} {% end %}
{% end %} {# Query Parameters #} {% if query_params | length > 0 %}

{{ icon('filter', size=14) }} Query Parameters

{% for p in query_params %} {% let param = p %} {% include 'autodoc/openapi/partials/param-row.html' %} {% end %}
{% end %} {# Header Parameters #} {% if header_params | length > 0 %}

{{ icon('file-text', size=14) }} Header Parameters

{% for p in header_params %} {% let param = p %} {% include 'autodoc/openapi/partials/param-row.html' %} {% end %}
{% end %} {# Cookie Parameters #} {% if cookie_params | length > 0 %}

{{ icon('disc', size=14) }} Cookie Parameters

{% for p in cookie_params %} {% let param = p %} {% include 'autodoc/openapi/partials/param-row.html' %} {% end %}
{% end %}
{% end %} {# Request Body #} {% with request_body as req_body %} {% include 'autodoc/openapi/partials/request-body.html' %} {% end %} {# Responses #} {% if responses | length > 0 %} {% cache 'openapi-responses-' ~ endpoint_path ~ '-' ~ http_method %} {% include 'autodoc/openapi/partials/responses.html' %} {% end %} {% end %} {# Security Requirements #} {% if security | length > 0 %}

{{ icon('lock', size=18) }} Authorization

{% for scheme in security %} {{ icon('key', size=12) }} {{ scheme }} {% end %}
{% end %}
{% end %} {% block code_examples %} {# Code Samples Panel #} {% let method = http_method %} {% let path = endpoint_path %} {% let response_example = get_response_example(responses, '200') %} {% include 'autodoc/openapi/partials/code-samples.html' %} {% end %}