Expand description
OpenAPI 3.1 specification generator for the Lemma HTTP surface.
Takes a Lemma Engine and produces a complete OpenAPI specification as JSON.
Used by both lemma server (CLI) and LemmaBase.com for consistent API docs.
§Temporal versioning
Specs can have multiple temporal versions (e.g. spec pricing 2024-01-01
and spec pricing 2025-01-01) with potentially different interfaces (data, rules,
types). The OpenAPI document reflects the interface active at a specific point in
time. Use generate_openapi_effective with an explicit DateTimeValue to get the
document for a given instant. generate_openapi is a convenience wrapper that uses
the current time.
For Scalar multi-source rendering, temporal_api_sources returns the list of
temporal version boundaries so the Scalar UI can offer a source selector.
Structs§
- ApiSource
- A single Scalar API reference source entry.
Constants§
- NOW_
SLUG - Query slug for the default temporal view (request-time instant). OpenAPI URLs use no
?effective=.
Functions§
- generate_
openapi - Generate a complete OpenAPI 3.1 specification using the current time.
- generate_
openapi_ effective - Generate a complete OpenAPI 3.1 specification for a specific point in time.
- temporal_
api_ sources - Compute the list of Scalar multi-source entries for temporal versioning.