Skip to main content

definitions_schema

Build a schema that contains both an inner schema and a list of definitions which can be used within the inner schema.

def definitions_schema(
schema: CoreSchema,
definitions: list[CoreSchema]
) - > DefinitionsSchema

Build a schema that contains both an inner schema and a list of definitions which can be used within the inner schema.

Parameters​

NameTypeDescription
schemaCoreSchemaThe primary inner schema that utilizes the provided definitions.
definitionslist[CoreSchema]A list of core schemas that serve as reusable definitions, typically identified by 'ref' keys, to be referenced within the inner schema.

Returns​

TypeDescription
DefinitionsSchemaA schema object of type 'definitions' containing the inner schema and its associated reference definitions.