stac-validator
stac-validator copied to clipboard
Add support for float values that are also valid integers
When validating a JSON document against a schema which specifies a property as type number, the validator indicates that the document is malformed if the property is a float value which is also a valid integer (ie 1.0, 2.0, 3.0, etc) and indicates that it is an integer and should be a float.
Example:
When checking property shown below with flags --lint and --verbose an error message is shown:
"$comment": "example property",
"proj:transform": [
1.0,
0.0,
5.0,
0.0,
1.0,
5.0
]
-- Lint: File is malformed -> use `--format` to fix the issue
- Expected
+ Received
"proj:transform": [
- 1.0,
+ 1,
- 0.0,
+ 0,
- 5.0,
+ 5,
- 0.0,
+ 0,
- 1.0,
+ 1,
- 5.0
+ 5
]