(
self,
function: ValidateCallSupportedTypes,
config: ConfigDict | None,
validate_return: bool,
parent_namespace: MappingNamespace | None,
)
| 64 | ) |
| 65 | |
| 66 | def __init__( |
| 67 | self, |
| 68 | function: ValidateCallSupportedTypes, |
| 69 | config: ConfigDict | None, |
| 70 | validate_return: bool, |
| 71 | parent_namespace: MappingNamespace | None, |
| 72 | ) -> None: |
| 73 | self.function = function |
| 74 | self.validate_return = validate_return |
| 75 | if isinstance(function, partial): |
| 76 | self.schema_type = function.func |
| 77 | self.module = function.func.__module__ |
| 78 | else: |
| 79 | self.schema_type = function |
| 80 | self.module = function.__module__ |
| 81 | self.qualname = extract_function_qualname(function) |
| 82 | |
| 83 | self.ns_resolver = NsResolver( |
| 84 | namespaces_tuple=ns_for_function(self.schema_type, parent_namespace=parent_namespace) |
| 85 | ) |
| 86 | self.config_wrapper = ConfigWrapper(config) |
| 87 | if not self.config_wrapper.defer_build: |
| 88 | self._create_validators() |
| 89 | else: |
| 90 | self.__pydantic_complete__ = False |
| 91 | |
| 92 | def _create_validators(self) -> None: |
| 93 | gen_schema = GenerateSchema(self.config_wrapper, self.ns_resolver) |
nothing calls this directly
no test coverage detected