{# One operation: what it is, a console that calls it, and what it answers with. A partial, so the page embeds it and an htmx click swaps it. It carries the target id itself and is swapped `outerHTML`, which is what lets the same file be both the initial render and the replacement. #} {% from "apidocs/macros.html" import field, op_line, param_table, payload %} {% from "ui/button.html" import button %} {% from "ui/data.html" import badge, card, item, item_list, link %} {% from "ui/feedback.html" import spinner %} {# `textarea_field` is the kit's own, as of 0.2. This template carried a local copy while it was still a roadmap item; keeping one now would mean a second textarea with its own idea of `hint` and no `error` — and `error` is the seam 0.3 fills in, which the console wants as much as any form does. The three attributes below ride through `**attrs`, and none is decoration: a JSON body under a spell-checker is a wall of red squiggles, and mobile autocapitalisation turns `{"title"` into `{"Title"`, a payload that fails validation for a reason nothing on screen explains. #} {% from "ui/form.html" import form, textarea_field %} {% from "ui/icon.html" import icon %} {% from "ui/layout.html" import divider, grid, section, stack %}
{{ operation.description }}
{% endif %} {% if operation.deprecated %}Deprecated. It still answers, but it is on its way out — check the changelog before building on it.
{% endif %} {# The document's two pointers outwards: the name every generated client gives this call, and the link its author wrote to the real explanation. Both are in the schema and neither usually survives being rendered, which leaves a reference less informative than the file it came from. #}{{ operation.operation_id }}
{% endif %}
{% if operation.external_url %}
{{ link(operation.external_label, operation.external_url) }}
{% endif %}
The document also accepts {{ operation.media_types | reject("equalto", operation.body_media) | join(", ") }}. The console sends {{ operation.body_media }}; use the curl snippet for the others.
{% endif %} {% endif %} {# Extra headers, folded away. Everything above is a control the document asked for; this is the escape hatch for the one it did not — a feature flag, an `If-None-Match`, a hand-typed `Accept` under deliberate test. It belongs on the page and not in the reading order: left open it is a two-line textarea between the parameters and the Send button, and it is empty on almost every call anybody makes. `{{ entry.media_type }}{% endif %}