{# Bengal OpenAPI Playground Bar ============================= Displays: HTTP method badge + endpoint path + copy button A compact, actionable header for API endpoints. Context: - method: HTTP method (GET, POST, PUT, PATCH, DELETE, etc.) - path: Endpoint path (e.g., "/users/{id}") - deprecated: bool (optional, default false) - base_url: Base API URL (optional) Kida Features: - {% spaceless %} for compact badge output - {% match %} for method styling - Optional chaining (?.) and null coalescing (??) #} {% let method_upper = method |> upper ?? 'GET' %} {% let method_lower = method |> lower ?? 'get' %} {% let is_deprecated = deprecated ?? false %} {% let api_base = base_url ?? '' %}
{# HTTP Method Badge #} {% spaceless %} {{ method_upper }} {% end %} {# Endpoint Path with highlighted params #} {% spaceless %} {{ path | highlight_path_params | safe }} {% end %}
{# Copy Button #}
{# Deprecated Banner (if applicable) #} {% if is_deprecated %} {% end %}