Skip to main content

schema.json_schema

schema.json_schema(kind)

The JSON Schema of one record kind, as a dict.

Parameters

Name Type Description Default
kind str "architecture", "unit" or "decision". required

Returns

Name Type Description
dict dict A draft-07 schema that uses only the keywords of the common subset of draft-04 and draft-07.

Raises

Name Type Description
KeyError If kind is not a record kind.

Examples

from babregen.schema import json_schema

schema = json_schema("decision")
print(schema["required"])
print(schema["properties"]["status"]["enum"])
['title', 'date', 'driver', 'decision', 'approved_by']
['active', 'superseded', 'expired']