Lemma.OpenAPI (lemma_engine v0.8.13)

Copy Markdown View Source

OpenAPI and temporal API docs helpers (lemma_openapi crate). Separate from core [Lemma] runtime.

Summary

Functions

Generates an OpenAPI 3.1 JSON document for the loaded specs (Lemma HTTP API shape).

Temporal version options for API docs (same boundaries as lemma serve / Scalar).

Functions

generate_openapi(engine, opts \\ [])

@spec generate_openapi(
  Lemma.engine(),
  keyword()
) :: {:ok, map()} | {:error, term()}

Generates an OpenAPI 3.1 JSON document for the loaded specs (Lemma HTTP API shape).

Options: :explanations (boolean, default false), :effective (datetime string or nil for "now").

temporal_api_sources(engine)

@spec temporal_api_sources(Lemma.engine()) :: {:ok, [map()]} | {:error, term()}

Temporal version options for API docs (same boundaries as lemma serve / Scalar).

Returns a list of maps with string keys "title" and "slug". Slug "now" means the latest interface at request time; other slugs match effective strings for generate_openapi/2.