Expand description
Shared plumbing for emitting API description documents (OpenAPI 3.1, AsyncAPI 3.0) from the endpoint model.
This module deliberately contains no OpenAPI- or AsyncAPI-specific shapes. It provides the three things both emitters need and neither should reimplement:
SchemaComponents— every referenced struct/enum collected once, at document scope rather than per-endpoint.relocate_refs— moving#/$defs/Xto wherever a given document format wants its shared definitions.apply_meta— themetapassthrough, which is the sanctioned way to get per-field and per-endpoint annotations into a document without growing the model.
It lives in endpoint-libs rather than endpointgen because a server needs the same registry walk at startup to answer MCP requests, and a future OpenRPC emitter would need it a third time.
The RON definitions are the source of truth. Nothing here parses a document; these are outputs only.
Structs§
- Schema
Components - Every struct and enum referenced by a set of endpoints, emitted once.
Constants§
- COMPONENTS_
SCHEMAS_ PREFIX - Where a document format keeps its shared schema definitions.
Functions§
- apply_
meta - Copies
metaontotarget, which must be a JSON object. - collect_
refs - Collects every
$reftarget string invalue. - json_
object - Builds a JSON object from
(key, value)pairs, skippingNonevalues. - object_
schema_ for_ fields - Object schema over a
Vec<Field>with refs already relocated. - relocate_
refs - Rewrites
#/$defs/Xto{prefix}Xthroughoutvalue, in place.