Diagnostic#
| Member | Kind | What it is |
|---|---|---|
parts | property | Return the segments of the path, an index of a list as its digits. |
pointer | property | Return the RFC 6901 JSON Pointer of the key, "" for the whole document. |
line | method | Return the diagnostic as one printable line. |
to_dict | method | Render the diagnostic as the record a refusal carries in details. |
with_severity | method | Return this diagnostic with another severity, the rest kept. |
code | attribute | Signature only |
detail | attribute | Signature only |
error_type | attribute | Signature only |
help | attribute | Signature only |
keys | attribute | Signature only |
line_number | attribute | Signature only |
path | attribute | Signature only |
severity | attribute | Signature only |
-
class Diagnostic(
)[source]#path,code,severity,detail='',help='',line_number=None,keys=None,error_type='',
One finding of a check, at one key of the document.
pathis the dotted key as the document spells it,flow.param.K.fieldorexport[0].variable, and""for the whole document.codeis one of the check codes, the keys of[check]inschema/phrases.toml.detailis what the validator said about this case, in English, andhelpthe description of the field atpathwhen the model has one.keysholds the exact segments of the path when it was read from a validation error, so a key that holds a dot or a slash keeps its pointer.error_typeis the Pydantic type of the fault when Pydantic raised it.- to_dict()[source]#
Render the diagnostic as the record a refusal carries in
details.The keys
pointer,loc,msgandtypeare those a refusal always carried.typeis the Pydantic type when there is one, else the code.lineis present only when the line is known.
- property parts: tuple[str, ...][source]#
Return the segments of the path, an index of a list as its digits.