Skip to main content

generate_openapi_effective

Function generate_openapi_effective 

Source
pub fn generate_openapi_effective(
    engine: &Engine,
    explanations_enabled: bool,
    effective: &DateTimeValue,
) -> Value
Expand description

Generate a complete OpenAPI 3.1 specification for a specific point in time.

The specification includes:

  • GET / — list loaded specs (name, data/rule counts)
  • /{spec_set_id} GET (schema: spec_set_id, effective_from, data, rules, meta, versions) and POST (evaluate: envelope spec, effective, result) with optional Accept-Datetime header
  • ?rules= on both methods to scope outputs
  • x-effective-from / x-effective-to vendor extensions on each PathItem exposing the half-open [effective_from, effective_to) range of the version resolved at the document’s effective instant (both null when unbounded)

CLI lemma server also exposes shell routes (/openapi.json, /health, /docs) that are intentionally omitted from the generated document.

When explanations_enabled is true, the document adds the x-explanations header parameter to evaluation operations and describes the optional explanation field on rule results.