Skip to content

ump_spec.schema_export

module ump-spec

Export JSON Schema 2020-12 for every public model (python -m ump_spec export-schemas <dir>).

The exported files are committed under packages/ump-spec/schemas/ and feed the web TS types (pnpm gen:spec). A test fails if the committed files drift from the models.

function

def schema_for(name: str) -> dict[str, Any]

Source: packages/ump-spec/src/ump_spec/schema_export.py, line 85

function

def all_schemas() -> dict[str, dict[str, Any]]

Source: packages/ump-spec/src/ump_spec/schema_export.py, line 91

function

def export_schemas(out_dir: str | Path) -> list[str]

Source: packages/ump-spec/src/ump_spec/schema_export.py, line 95

NameTypeValueDescription
SCHEMA_BASE_URI'https://schemas.ump.dev/v1/'
JSON_SCHEMA_DIALECT'https://json-schema.org/draft/2020-12/schema'
SCHEMA_MODELSdict[str, type[BaseModel]]{'estimand': _m.Estimand, 'applies-to': _m.AppliesTo, 'interval': _m.Interval...