Closed dennisameling closed 1 year ago
I think we should keep all Big* impls as string, because JavaScript is not good in handling those types as numbers and it's just a safer default. Speaking of the custom type nullability, I'll definitely take a look at it in the evening :)
So, the issue here is that it's declared as Double::class
which is translated to double.class
and primitives cannot be null. If you'd declare this type as java.lang.Double::class
then it'd work like that, so technically it's not a bug 😛 I'll push change change with custom nullability tho since it's needed anyway :)
Hi! When using
BigDecimal
as a property type, it's being marked as "string" in the OpenAPI spec:However the serializer (Jackson) turns it into a
double
(which we expect it to do), so the API output is inconsistent with the OpenAPI spec:I tried setting
OpenApiPropertyType
toDouble
, but then the OpenAPI property spec loses its nullability 😅One solution I could think of is adding a
nullable
argument toOpenApiPropertyType
, so something like@get:OpenApiPropertyType(definedBy = Double::class, nullable = true)
. What do you think about that? Or did I simply miss an existing feature for this?Thanks in advance again! Appreciate all your work on this library 😊