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

JsonNumber::isIntegral did not have the same semantic meaning as in json-schema #123

Open
sebastian-toepfer opened this issue Feb 13, 2024 · 0 comments

Comments

@sebastian-toepfer
Copy link

unsure if it is a bug in json-p spec or here.

in json-schema 0.0 or 1.0 are valid integer values, but not for JsonNumber::isIntegral.

instead of

public boolean isIntegral() {
  bigdecimal().scale() == 0
}

it should be

public boolean isIntegral() {
  bigdecimal().stripTrailingZeros().scale() <= 0
}
@sebastian-toepfer sebastian-toepfer changed the title JsonNumber::isIntegral hatte nicht dieselbe semantische Bedeutung wie in json-schema JsonNumber::isIntegral did not have the same semantic meaning as in json-schema Feb 22, 2024
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

1 participant