MCPcopy
hub / github.com/pydantic/pydantic / errors

Method errors

pydantic/v1/error_wrappers.py:58–65  ·  pydantic/v1/error_wrappers.py::ValidationError.errors
(self)

Source from the content-addressed store, hash-verified

56 self._error_cache: Optional[List[&class="cm">#x27;ErrorDict']] = None
57
58 def errors(self) -> List[&class="cm">#x27;ErrorDict']:
59 if self._error_cache is None:
60 try:
61 config = self.model.__config__ class="cm"># type: ignore
62 except AttributeError:
63 config = self.model.__pydantic_model__.__config__ class="cm"># type: ignore
64 self._error_cache = list(flatten_errors(self.raw_errors, config))
65 return self._error_cache
66
67 def json(self, *, indent: Union[None, int, str] = 2) -> str:
68 return json.dumps(self.errors(), indent=indent, default=pydantic_encoder)

Calls 1

flatten_errorsFunction · 0.85