Name your spec in aiui.yaml; aiui validate and aiui build load and check it.
aiui.yaml
aiui validate
aiui build
http(s)
http://localhost:8080/openapi.json
$ref
paths/pets.yaml
../common.yaml#/components/schemas/Error
resolves relative to the file naming it, URLs too, and is bundled in: no pre-bundling.
Recursive schemas, across files too, stay finite.
nullable
exclusiveMinimum/exclusiveMaximum, schema example); the published file keeps your version.
exclusiveMinimum
exclusiveMaximum
example
openapi also goes on a navigation tab or group: a path or URL, {source, directory} or a
openapi
{source, directory}
list of either. A spec named twice loads once. directory: the URL folder of its endpoint pages
directory
(default api-reference).
api-reference
Each problem names its file, line and JSON pointer (`openapi.yaml:42: $ref '#/x' does not
resolve (at #/components/schemas/Pet/properties/owner)). Errors fail validate` and
). Errors fail
build: an unreadable file or URL, YAML/JSON syntax, a missing or unsupported openapi
build
version, info without title/version, a $ref that does not resolve, a path not
info
title
version
starting with /, a duplicate operationId. Warning: a {param} with no path parameter.
/
operationId
{param}
aiui build writes openapi/<slug>.json (the spec bundled into one file, x-excluded
openapi/<slug>.json
x-excluded
operations removed; <slug>: file name, -2 on a clash), openapi/index.json
<slug>
-2
openapi/index.json
({"specs": [{source, file, title, openapi, version, operations}]}), an "OpenAPI specs"
{"specs": [{source, file, title, openapi, version, operations}]}
section in llms.txt and an RFC 9727 API catalog at
llms.txt
/.well-known/api-catalog (each API's base URL, spec and first endpoint page).
/.well-known/api-catalog
Every operation and 3.1 webhook gets a docs page, generated at build time as Markdown with
the API field components: the endpoint bar with Try it, server URL,
deprecation notice, path / query / header / cookie parameters, request body,
each response (schemas with oneOf/anyOf tabs, constraints and conditional
oneOf
anyOf
requirements), request examples in several languages, response examples, callbacks and a link to the spec. They publish like hand-written pages: agent .md, llms.txt,
.md
llms-full.txt, sitemap and site search (which also matches METHOD /path, the
llms-full.txt
METHOD /path
operationId and every parameter and body field name).
| Spec | Result |
|---|---|
| api.openapi only | an "API Reference" group at the end of the sidebar |
api.openapi
| openapi on a tab | its tag groups join the tab ("API Reference" for untagged operations) |
| openapi on a group | its tag groups go inside that group |
| tags | one sidebar group per operation's first tag; label: x-group, x-displayName, summary, then name; 3.2 parent nests groups; a tag with another kind (badge) makes no group |
tags
x-group
x-displayName
summary
name
parent
kind
badge
| untagged webhook | a "Webhooks" group |
| x-hidden: true | page built and routable, not in the sidebar or indexes |
x-hidden: true
| x-excluded: true | no page, and removed from the published spec |
x-excluded: true
| deprecated: true | a deprecation notice |
deprecated: true
URL: /docs/<directory>/<tag name>/<slug>, the slug from the operationId (listPets ->
/docs/<directory>/<tag name>/<slug>
listPets
list-pets, so rewording a summary keeps the URL), else the summary, else method and path
list-pets
(get-pets-id). x-aiui: {href: /reference/pets} sets the whole path (kebab-cased, ..
get-pets-id
x-aiui: {href: /reference/pets}
..
dropped; see page settings). A slug already taken (by a hand-written page or another endpoint) gets -2, -3.
-3
The title is the summary as written, else the operationId in words. aiui validate
warns about a duplicate tag, an unknown parent and a parent cycle.
Each field shows what the schema says, at build time, in the page Markdown (so agents and
search see it too):
| Schema | On the page |
| $ref, allOf | followed and merged into one field list |
allOf
| oneOf / anyOf | tabs, one per choice, titled by its title, else its $ref name, else its type, else "Option n"; at the top of a body or response too |
| nullable: true, type: [x, "null"], anyOf: [X, {type: "null"}] | x \| null in the type; the field still expands to X's properties |
nullable: true
type: [x, "null"]
anyOf: [X, {type: "null"}]
x \| null
| object[], nested objects | properties nested under "Show properties", a recursive schema stops one level down |
object[]
| enum, const | "Available options: card, bank", "Allowed value: card" |
enum
const
card
bank
| minimum/maximum (exclusive too), minLength/maxLength, minItems/maxItems, pattern | "Required range: 1 <= x < 100", "Required string length: 16 - 19", "Required array length: >= 1 elements", "Pattern: ^[0-9]+$" |
minimum
maximum
minLength
maxLength
minItems
maxItems
pattern
1 <= x < 100
16 - 19
>= 1
^[0-9]+$
| examples / example on a field | "Example: 5" (short values) |
examples
5
| additionalProperties, not | "Additional properties: string", "Must not match: integer" |
additionalProperties
not
string
integer
| if/then/else, dependentRequired, dependentSchemas (also inside allOf) | a pill on each affected field: "required if method = card", "required unless method = card", "required if owner is set"; an if that tests more than sibling const / enum / required shows "conditionally required" |
if
then
else
dependentRequired
dependentSchemas
required
The side column's response example has one tab per status code, content type (when a response
has several) and named example (its summary, else its key). This gives the tabs
200 · application/json · A small cat, 200 · application/json · big and 200 · application/xml:
200 · application/json · A small cat
200 · application/json · big
200 · application/xml
Per content type: the examples map (value, 3.2 dataValue / serializedValue, or the
value
dataValue
serializedValue
externalValue URL), else example, else for JSON an example built from the schema. JSON is
externalValue
pretty-printed (a JSON string too); XML, HTML, YAML and CSV are highlighted; other types are text.
The side column shows the request as code, one tab per language: cURL, Python and
JavaScript by default. A pick is remembered, so every endpoint page opens on the reader's
language. Each sample is built at build time from the spec: the server URL (variables set to
their defaults; a relative or missing server is joined to https://api.example.com), path
https://api.example.com
parameters (their example, else a {name} placeholder), required query, header and cookie
{name}
parameters and any with an example, the first security requirement as a placeholder
(Bearer <token>, Basic <encoded-value>, an API key <api-key> in its header, query or
Bearer <token>
Basic <encoded-value>
<api-key>
cookie) and the body (its first example, else one made from the schema without readOnly
readOnly
fields). JSON, form-urlencoded and plain-text bodies work in every language; multipart/form-data
multipart/form-data
in cURL, Python and JavaScript (a format: binary field is sent as a file).
format: binary
Languages: curl, python, javascript, go, java, ruby, php, csharp, rust,
curl
python
javascript
go
java
ruby
php
csharp
rust
swift (also shell, node, js, py, c#, dotnet, ...). aiui validate names an
swift
shell
node
js
py
c#
dotnet
unknown one.
Your own samples, from an SDK say, go in the operation's x-codeSamples (or x-code-samples).
x-codeSamples
x-code-samples
They come first, in their order; one in a generated language replaces that sample, any other
language adds a tab. label is the tab title (default: the language's name).
label
The agent .md export, llms-full.txt and the page source keep every sample as a fence.
Under the title, every endpoint page has an endpoint bar (method, path, copy) and Try it: a
request form with a server menu (operation, path, then spec servers) and an input per server
servers
variable, an input per path, query, header and cookie parameter (enum and boolean as menus,
arrays comma-separated, empty required ones named before sending) and the body to edit
(multipart/form-data as a JSON object of its fields). Inputs start with x-default, else the
x-default
example (example, examples, default, const, first enum value); the body with its first
default
example, else one made from the schema. Beside them: the curl command for exactly what will be
sent, live, with copy, and after Send the status, time, size, headers and body (JSON
pretty-printed). A relative or missing server URL means the site the docs are served from.
With auth, the bar asks GET /api/auth/status once per page load and shows Try it only when it
auth
GET /api/auth/status
answers authenticated: true (an aiui serve or create_app site whose reader is signed in;
authenticated: true
aiui serve
create_app
without sign-in configured, every reader counts as signed in). On a static host it acts like
simple.
simple
Webhooks have no Try it. Front matter playground: (same values) sets the display of one
playground:
openapi: or api: page, x-aiui metadata.playground of
openapi:
api:
x-aiui
metadata.playground
one generated page.
The request goes straight from the reader's browser to your API: no proxy, so it works on a
static host and keys never pass through a third party, and the browser's CORS rules apply. The
API must allow the docs site's origin (Access-Control-Allow-Origin; for custom headers or a
Access-Control-Allow-Origin
JSON body, a preflight OPTIONS with Access-Control-Allow-Headers). A blocked request says it
OPTIONS
Access-Control-Allow-Headers
"did not reach the API" (the curl command still works in a terminal). Response headers other
than the CORS-safelisted ones show only when listed in Access-Control-Expose-Headers; a cookie
Access-Control-Expose-Headers
parameter goes only into the curl command (a browser sends just the cookies it holds).
aiui build writes each page's form data to openapi/try/<page>.json; the form is a lazy chunk
openapi/try/<page>.json
loaded on the first hover, focus or click of Try it. In the page source the bar is
<ApiPlayground method="GET" path="/pets" src="/openapi/try/....json" /> (without src, the bar
<ApiPlayground method="GET" path="/pets" src="/openapi/try/....json" />
src
alone, usable on a hand-written page); the agent .md keeps ` GET /pets `.
An operation's security (else the spec's) becomes an Authorization section on its page (a
security
field per scheme, required when every alternative needs it, OAuth2 scopes listed) and inputs in
Try it: apiKey in a header, query or cookie, http bearer (and any other scheme name),
apiKey
http
bearer
http basic (username and password, base64-encoded for you), oauth2 and openIdConnect (paste
basic
oauth2
openIdConnect
an access token; sent as Bearer). With several alternatives a menu picks one ({} in the list
Bearer
{}
adds "None"); security: [] turns it off; mutualTLS is left out (a browser cannot send it).
security: []
mutualTLS
A scheme's x-default prefills its input.
Values are kept in the browser tab's sessionStorage per docs site (gone when the tab closes,
sessionStorage
never localStorage) and sent only with the request itself. The curl command shows them as
localStorage
****** until Show values**; the request examples on the page keep placeholders
******
(Bearer <token>).
byte
contentMediaType; the chosen file replaces that field (curl --form 'photo=@cat.png').
contentMediaType
--form 'photo=@cat.png'
application/octet-stream
image/*
audio/*
video/*
format: binary schema): one file input, sent as the body (curl --data-binary).
--data-binary
format: byte
contentEncoding: base64
base64url
that writes the file's encoding into the body.
text/event-stream
as a list (event name, id, data with JSON pretty-printed), other streams as text. Stop
ends it; reading stops at 10 MB; a broken connection says "Stream interrupted."
(planned): method and kind: badge pills in the
kind: badge
sidebar, a choice picker for any fields, api.optional, and showing image, audio and video responses inline.
any
api.optional
Name an operation in a page's front matter and the page shows it: the endpoint bar and Try it
under your # title, your Markdown, then the generated parameters, body, responses and
#
request and response examples.
"GET /users"
"admin.yaml POST /users"
(its name is enough; a file only pages name is loaded, relative to aiui.yaml, and published);
"webhook user-created" names a webhook.
"webhook user-created"
description
the spec's description shows only when the page has no text of its own.
playground: simple
none
api: makes an endpoint page from the page alone: the bar, and Try it with an input per
<ParamField> (placeholder, else default, as the example), per {param} in the path, and a
<ParamField>
placeholder
JSON body of the body fields.
body
A pages: entry can be an operation: "GET /users", "admin.yaml POST /users" or
pages:
"webhook user-created". Without a file it comes from the nearest group or tab with openapi,
else api.openapi, else any spec. When a spec's own group (or api.openapi) lists operations,
only the listed ones get pages, each where it is listed, and no tag groups are added. An entry
for an operation a page shows (openapi: front matter) links that page.
aiui validate names a reference that matches no operation (7012).
An operation's x-aiui sets its generated page: metadata is front matter (title,
metadata
sidebarTitle, description, playground, tag, og:*, ...), content is Markdown shown
sidebarTitle
playground
tag
og:*
content
above the description (any docs component works) and href the page URL. The x-mint key
href
x-mint
other docs tools write is read too; x-aiui wins where both set a value.
From Python, praisonaiui.compiler.openapi.load_spec("openapi.yaml") returns an ApiSpec
praisonaiui.compiler.openapi.load_spec("openapi.yaml")
ApiSpec
(ok, issues, document, operations, dereference(node)).
ok
issues
document
operations
dereference(node)