frictionlessdata / tableschema-java

A Java library for working with Table Schema.
MIT License
25 stars 21 forks source link

Fixed Integer field constraints to match BigInteger implementation #59

Closed jeffreymichaelis closed 3 years ago

jeffreymichaelis commented 3 years ago

Constraints for integer and number fields were not being checked properly

As the implementation of number field and integer field both use BigNumber and BigInteger which inherit from Number not Integer checking "instanceof Integer" would never be true causing constraint validation to always pass for these fields.

Updated unit tests to use the correct data type.

Also added year constraint check as it was not present.


Please preserve this line to notify @iSnow (lead of this repository)

iSnow commented 3 years ago

Thanks for the PR, you are completely right - as I switched the datatype away from Integer, this one escaped my attention.