{#-
Endpoint Description Component

Renders endpoint description with metadata and status information.
Handles deprecation warnings and operational details safely.
-#}

{% from 'macros/safe_macros.md.jinja2' import safe_section %}

{% call safe_section("endpoint_description") %}
{% if element.description %}
{{ element.description }}
{% else %}
*No endpoint description provided.*
{% endif %}

{% if element.metadata.summary %}
## Summary

{{ element.metadata.summary }}
{% endif %}

{% if element.metadata.deprecated %}
:::{warning} Deprecated Endpoint
This endpoint is deprecated and may be removed in future versions.
{% if element.metadata.deprecation_message %}
{{ element.metadata.deprecation_message }}
{% endif %}
:::
{% endif %}

{% if element.metadata.experimental %}
:::{note} Experimental Endpoint
This endpoint is experimental and may change without notice.
:::
{% endif %}

{% if element.metadata.operation_id %}
**Operation ID:** `{{ element.metadata.operation_id }}`
{% endif %}

{% if element.metadata.tags %}
**Tags:** {{ element.metadata.tags | format_list }}
{% endif %}

{% if element.metadata.external_docs %}
**External Documentation:** [{{ element.metadata.external_docs.description | default('Documentation') }}]({{ element.metadata.external_docs.url }})
{% endif %}
{% endcall %}
