A Pydantic field_validator in after mode is given json_schema_input_type, which only the other modes accept
What it finds
json_schema_input_type describes what a validator accepts before the field's own validation, so it applies to before, plain and wrap validators. An after validator sees the already validated type, and Pydantic rejects the combination.
From the rule's source, validator_input_type_after.rs.
from pydantic import BaseModel, field_validator class M(BaseModel): x: int @field_validator("x", mode="after", json_schema_input_type=str)tx0 reports: json_schema_input_type does not apply @classmethod def a(cls, v): return v @field_validator("x", mode="before", json_schema_input_type=str) @classmethod def b(cls, v): return int(v) Turn it on, off or suppress it
The rule runs in every tier. To turn it off for a project, set its level in tx0.toml:
[rules]
"tx0/python:validator-input-type-after" = "off"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
# tx0: ignore[tx0/python:validator-input-type-after] reason="..."tx0 explain tx0/python:validator-input-type-after shows the same in the terminal. Found a false positive? Report it.