Web Frameworks

PyPydantic

Pydantic provides strict type-validated models. BaseModel parses / coerces input and raises on mismatch — the parsed model is a sanitizer for the raw input. Still, string fields on the model can remain tainted (not magically escaped).

3 sanitizers

Sanitizers

.BaseModel()Sanitizer
#
Signature
pydantic.BaseModel(**data: Any)

Constructs a validated model. Sanitizer for type / shape. String fields remain tainted.

tracks:return
.parse_obj()Sanitizer
#
Signature
BaseModel.parse_obj(obj: Any) -> BaseModel

Parses a dict into a model. Sanitizer for shape.

tracks:return
.parse_raw()Sanitizer
#
Signature
BaseModel.parse_raw(b: str | bytes, ...) -> BaseModel

Parses JSON / bytes into a model. Sanitizer.

tracks:return

Fully-Qualified Names

FQNField
pydanticfqns[0]
pydantic.BaseModelfqns[1]

Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.

Import

rule.py
from codepathfinder.go_rule import PyPydantic