Diagnostic#

MemberKindWhat it is
partspropertyReturn the segments of the path, an index of a list as its digits.
pointerpropertyReturn the RFC 6901 JSON Pointer of the key, "" for the whole document.
linemethodReturn the diagnostic as one printable line.
to_dictmethodRender the diagnostic as the record a refusal carries in details.
with_severitymethodReturn this diagnostic with another severity, the rest kept.
codeattributeSignature only
detailattributeSignature only
error_typeattributeSignature only
helpattributeSignature only
keysattributeSignature only
line_numberattributeSignature only
pathattributeSignature only
severityattributeSignature only
class Diagnostic(
path,
code,
severity,
detail='',
help='',
line_number=None,
keys=None,
error_type='',
)[source]#

One finding of a check, at one key of the document.

path is the dotted key as the document spells it, flow.param.K.field or export[0].variable, and "" for the whole document. code is one of the check codes, the keys of [check] in schema/phrases.toml. detail is what the validator said about this case, in English, and help the description of the field at path when the model has one. keys holds 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_type is the Pydantic type of the fault when Pydantic raised it.

line()[source]#

Return the diagnostic as one printable line.

to_dict()[source]#

Render the diagnostic as the record a refusal carries in details.

The keys pointer, loc, msg and type are those a refusal always carried. type is the Pydantic type when there is one, else the code. line is present only when the line is known.

with_severity(severity)[source]#

Return this diagnostic with another severity, the rest kept.

code: str#
detail: str#
error_type: str#
help: str#
keys: tuple[str, ...] | None#
line_number: int | None#
property parts: tuple[str, ...][source]#

Return the segments of the path, an index of a list as its digits.

path: str#
property pointer: str[source]#

Return the RFC 6901 JSON Pointer of the key, "" for the whole document.

severity: Literal['error', 'warning', 'to_fill']#