eclipse-ee4j / eclipse-ee4j/parsson

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

Open
#123 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
17
Forks
25
PR merge metrics
No merged PRs in 30d

Description

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
```java
public boolean isIntegral() {
bigdecimal().scale() == 0
}
```
it should be
```java
public boolean isIntegral() {
bigdecimal().stripTrailingZeros().scale() <= 0
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.