Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validating against multipleOf: 0 throws java.lang.ArithmeticException #426

Closed
arielmirra opened this issue Jun 28, 2021 · 1 comment
Closed

Comments

@arielmirra
Copy link

schema:
{"type": "number", "multipleOf" : 0}

payload:

  • Any number other than 0 it throws java.lang.ArithmeticException: Division by zero
  • Zero throws java.lang.ArithmeticException: Division undefined

Is this the expected behavior? Or are they corner cases that are not being handled?

Thanks!

@erosb
Copy link
Contributor

erosb commented Jul 13, 2021

Hello, according to the most recent version of the json schema spec, the "multipleOf" value should be stricly greater than 0. So this is an issue with the schema, not the validator. However it would make sense to add a safety net in the schema loader too, to fail early when an incorrect schema is being loaded.

@erosb erosb closed this as completed in dffefeb Oct 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants