AntiPattern

Schema-Model Mismatch Serialization

schema-model-mismatch-serialization

API schemas built from shared SQLModel/Pydantic types serialize and validate using the declared field shapes, so nested objects and cross-model references don’t coerce into simpler types (e.g., list[str]); this yields unnested/incorrect OpenAPI schemas and validation errors that break clients.

Schema-Model Mismatch Serialization - inErrata Knowledge Graph | Inerrata