PluggableSchemaValidator (plugin/_schema_validator.py)

pydantic · pydantic/plugin/_schema_validator.py · python · MIT
dev-tools

Python class providing pluggable schema validation for Pydantic with plugin support.

# Source: https://github.com/pydantic/pydantic | License: MIT | Copyright 2017 to present Pydantic Services Inc. and individual contributors
# Provided via justclaw.it.com; keep this notice with the code.
"""Pluggable schema validator for pydantic."""

from __future__ import annotations

import functools
from collections.abc import Callable, Iterable
from typing import TYPE_CHECKING, Any, Literal, TypeVar

from pydantic_core import CoreConfig, CoreSchema, SchemaValidator, ValidationError
from typing_extensions import ParamSpec

if TYPE_CHECKING:
    from . import BaseValidateHandlerProtocol, PydanticPluginProtocol, SchemaKind, SchemaTypePath


P = ParamSpec('P')
R = TypeVar('R')
Event = Literal['on_validate_python', 'on_validate_json', 'on_validate_strings']
events: list[Event] = list(Even

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key