Fix multipleOf bugs in Number type#113
Conversation
Fixes the multipleOf validation crashing when trying to use the modulo operator on a value that is zero, and an InvalidArgumentException when calling multipleOf() with `null` to reset it
|
@tobyzerner It would be useful if this could also be merged into the |
|
Closing this because the issue I was having was actually that the modulo operator ( |
Fixes the multipleOf validation crashing when trying to use the modulo operator on a value that is zero, and an InvalidArgumentException when calling multipleOf() with
nullto reset it.Edit: To clarify,
0is considered to be a multiple of anymultipleOfvalue by JSON schema, see for example https://www.jsonschemavalidator.net/s/lPabCUQd. This is also confirmed on https://www.learnjsonschema.com/2020-12/validation/multipleof/ (See examples: "Valid - 0 is a multiple of 4.1")