dlt.common.reflection.json_schema
JSON Schema of Python type hints, configspecs and TypedDicts.
TAnnotate
Keywords an Annotated metadata item adds to a schema, or None when it adds none.
DATA_TYPE_SCHEMAS
JSON Schema of each dlt data type a Python type maps to.
annotated_description
def annotated_description(hint: Any) -> Optional[str]
Description an Annotated hint carries: a Doc marker, or a plain string.
json_default
def json_default(value: Any) -> Any
value as a JSON Schema default, or None when it has no JSON form.
JsonSchemaBuilder Objects
class JsonSchemaBuilder()
Builds JSON Schemas of type hints, collecting nested TypedDicts and configspecs in defs.
hint_schema
def hint_schema(hint: Any) -> Dict[str, Any]
JSON Schema of hint, nested object types referenced from defs.
typed_dict_schema
def typed_dict_schema(td: Any) -> Dict[str, Any]
Object schema of a TypedDict, NotRequired keys left out of required.
spec_schema
def spec_schema(
spec: Type[BaseConfiguration], exclude: Collection[str] = ()
) -> Dict[str, Any]
Object schema of a configspec, one property per field configuration resolves.
root_schema
def root_schema(hint: Any) -> Dict[str, Any]
Self-contained schema of hint, an object type inlined at the root.
with_defs
def with_defs(schema: Dict[str, Any]) -> Dict[str, Any]
schema with the definitions it refers to, directly or through other definitions.
prune_unreferenced_defs
def prune_unreferenced_defs(schema: Dict[str, Any]) -> None
Drops the $defs nothing points at, following the references between those kept.