Closed johnthagen closed 2 years ago
Describe the bug OpenApiParameter with the native Python float type is formatted as a 32-bit float rather than 64-bit double.
OpenApiParameter
float
double
Related to #674
To Reproduce
Use drf-spectacular 0.22.0.
drf-spectacular
input_param = OpenApiParameter( name="input", description="Description", type=float, default=1.0, ) class MyViewSet(RetrieveModelMixin, GenericViewSet): @extend_schema(parameters=[input_param]) def retrieve(self, request: Request, *args: Any, **kwargs: str) -> Response: ...
The resulting schema:
schema: type: number format: float default: 1.0
Expected behavior
Expected schema
schema: type: number format: double default: 1.0
well, that was a kind of obvious oversight, but iteration is our business, right? :laughing:
I can confirm that 0.22.1 fixes this issue. Thanks!
Describe the bug
OpenApiParameter
with the native Pythonfloat
type is formatted as a 32-bitfloat
rather than 64-bitdouble
.Related to #674
To Reproduce
Use
drf-spectacular
0.22.0.The resulting schema:
Expected behavior
Expected schema