Skip to main content

build_schema_validator_with_globals

No overview available.

def build_schema_validator_with_globals(
schema: dict,
globals: dict
) - > jsonschema.protocols.Validator

Constructs a JSON schema validator that incorporates a set of global definitions for cross-schema referencing. This is used to ensure that individual schemas can resolve shared components or common data structures defined in a central registry.

Parameters

NameTypeDescription
schemadictThe primary JSON schema used to validate data instances.
globalsdictA dictionary of shared schema definitions that are injected into the validator's scope for resolution.

Returns

TypeDescription
jsonschema.protocols.ValidatorA validator instance configured with the provided schema and a resolver that handles global references.