Skip to main content

generate_openapi_effective

Function generate_openapi_effective 

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

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

The specification includes:

  • GET / — loaded specs (Engine::specs)
  • /{spec} GET (show: Show from api.v1.json) and POST (evaluate: Response / RuleResult from api.v1.json) with optional Accept-Datetime header
  • ?rules= on POST only, to limit evaluated rules
  • 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 explain is true, the document adds the x-explain header parameter to evaluation operations and describes the optional explanation field on rule results.