clientele
clientele copied to clipboard
`number` should be rendered as type `float`, not `int`
Django-ninja sets the type of float data type as number in openapi and clientene renders number as int which causes pydantic validation error.
openapi.json
{
"openapi": "3.1.0",
"info": {
"title": "NinjaAPI",
"version": "1.0.0",
"description": ""
},
"paths": {},
"components": {
"schemas": {
"Pet": {
"properties": {
"age": {
"type": "number"
}
},
"required": [],
"title": "Pet",
"type": "object"
}
}
}
}
Output:
class Pet(pydantic.BaseModel):
age: int
Expected:
class Pet(pydantic.BaseModel):
age: float