Class AbstractPythonCodegen.PydanticCoercibleType
- java.lang.Object
-
- org.openapitools.codegen.languages.AbstractPythonCodegen.PydanticType
-
- org.openapitools.codegen.languages.AbstractPythonCodegen.PydanticCoercibleType
-
- Enclosing class:
- AbstractPythonCodegen
protected class AbstractPythonCodegen.PydanticCoercibleType extends AbstractPythonCodegen.PydanticType
Pydantic type generator for values that arrive over the wire as strings — server-bound request parameters in path, query, header, and cookie position. These rely on Pydantic's automatic coercion (e.g."3" -> 3); the strict types emitted by the baseAbstractPythonCodegen.PydanticType(StrictInt/StrictStr/StrictFloat,strict=True) disable that coercion and make FastAPI reject otherwise-valid requests with a 422. See issue #21905.Request bodies and models are not wire-string values — they carry real JSON types — so they keep the strict base behaviour.
-
-
Field Summary
-
Fields inherited from class org.openapitools.codegen.languages.AbstractPythonCodegen.PydanticType
classname, DECIMAL, exampleImports, modelImports, moduleImports, postponedExampleImports, postponedModelImports, TYPING
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.openapitools.codegen.languages.AbstractPythonCodegen.PythonTypeboolType(IJsonSchemaValidationProperties cp)protected org.openapitools.codegen.languages.AbstractPythonCodegen.PythonTypedecimalType(IJsonSchemaValidationProperties cp)protected org.openapitools.codegen.languages.AbstractPythonCodegen.PythonTypeintType(IJsonSchemaValidationProperties cp)protected org.openapitools.codegen.languages.AbstractPythonCodegen.PythonTypenumberType(IJsonSchemaValidationProperties cp)protected org.openapitools.codegen.languages.AbstractPythonCodegen.PythonTypestringType(IJsonSchemaValidationProperties cp)-
Methods inherited from class org.openapitools.codegen.languages.AbstractPythonCodegen.PydanticType
anyType, arrayType, binaryType, collectionItemType, dateType, fromCommon, generatePythonType, generatePythonType, getType, getType, mapType, modelType, uuidType
-
-
-
-
Method Detail
-
stringType
protected org.openapitools.codegen.languages.AbstractPythonCodegen.PythonType stringType(IJsonSchemaValidationProperties cp)
- Overrides:
stringTypein classAbstractPythonCodegen.PydanticType
-
numberType
protected org.openapitools.codegen.languages.AbstractPythonCodegen.PythonType numberType(IJsonSchemaValidationProperties cp)
- Overrides:
numberTypein classAbstractPythonCodegen.PydanticType
-
intType
protected org.openapitools.codegen.languages.AbstractPythonCodegen.PythonType intType(IJsonSchemaValidationProperties cp)
- Overrides:
intTypein classAbstractPythonCodegen.PydanticType
-
boolType
protected org.openapitools.codegen.languages.AbstractPythonCodegen.PythonType boolType(IJsonSchemaValidationProperties cp)
- Overrides:
boolTypein classAbstractPythonCodegen.PydanticType
-
decimalType
protected org.openapitools.codegen.languages.AbstractPythonCodegen.PythonType decimalType(IJsonSchemaValidationProperties cp)
- Overrides:
decimalTypein classAbstractPythonCodegen.PydanticType
-
-