-
-
Notifications
You must be signed in to change notification settings - Fork 461
Description
In my openapi file, I have one property that is described as follows:
Quantity:
type: number
maximum: 999999999.99
minimum: -999999999.99
multipleOf: 0.01
The problem is that not every value provided as Quantity passes validation.
This part of lib code seems to be responsible for random outcome: kin-openapi/openapi3/schema.go#L1508 as the division value/0.01 sometimes gives a rounded value (so it’s Int and it passes validation), but sometimes it gives decimal outcome and the validation returns an error.
Here are some examples of Quantity for which division by 0.01 returns Int, so the validation passes:
8.11
68.15
2130.46
5895083
And here are some examples of Quantity for which division by 0.01 returns non-Int, so the validation fails:
8.1
2.07
19628.87
323.39
40428.2
I believe some adjustments to this validation should be provided.