value for multipleOf #364
-
Hey! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Generally, yes. In the schema generator, the Short-term, you could basically re-implement the configuration with your desired precision: Mid-term, we could assume a certain maximum precision (let's say: rounded to 10 decimal digits) and then cut off trailing zeros. That would cover your use case at least. |
Beta Was this translation helpful? Give feedback.
Hi @AleksanderBialik,
Generally, yes. In the schema generator, the
multipleOf
value is treated as aBigDecimal
, i.e., you can explicitly set thescale
(number of decimal digits).Unfortunately, on the swagger
@Schema
annotation, themultipleOf
parameter is of typedouble
which has this precision problem.Short-term, you could basically re-implement the configuration with your desired precision:
jsonschema-generator/jsonschema-module-swagger-2/src/main/java/com/github/victools/jsonschema/module/swagger2/Swagger2Module.java
Line 92 in baea9b6
jsonschema-generator/jsonschema-module-swagger-2/src/main/java/…