Skip to main content

Crate lemma_openapi

Crate lemma_openapi 

Source
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.