Commit 4decf3c
committed
refactor(python): express param strictness as a type, not a flag
Replace the relaxStrict boolean + shouldRelaxStrictParameterTyping hook with
an explicit PydanticCoercibleType subclass of PydanticType that never emits
Pydantic strict types for the scalar kinds where strictness blocks coercion.
Selection moves into a getPydanticParameterType() factory: PythonFastAPIServer
returns PydanticCoercibleType for path/query/header params and the strict base
type for everything else. The rule ("wire-string params are never strict") is
now a code structure rather than a flag callers must remember to set, and the
explanatory comment lives in one place on the class it describes.
Behaviour-preserving: the regenerated python-fastapi sample is byte-identical
to the previous commit. Python codegen tests (fastapi, client) pass.
Claude-Session: https://claude.ai/code/session_019g7iwAyg7ErX1WrhqHyTn61 parent 47eb4c2 commit 4decf3c
2 files changed
Lines changed: 204 additions & 106 deletions
File tree
- modules/openapi-generator/src/main/java/org/openapitools/codegen/languages
0 commit comments