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.