You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While IEEE floating point numbers support a greater range, decimal supports greater precision, which often is needed more, for instance in financial applications.
JSON itself supports arbitrary-precision numbers, but it also does have a note that computers have limitations in numeric representation.
JSON Schema has no such requirements, instead deferring to JSON.
I've even marked the appropriate test as skipped in the test suite as listed on Bowtie (find my implementation and click "Details").
@marcschier I have a workaround for you: copy the existing keywords that use decimal (i.e. MinimumKeyword, etc.) and modify them to use double. Then you just need to register them, and they should work just fine.
Nuget Package
JsonSchema.Net
Package Version
7.0.4
Operating System
None
.Net Target (if relevant, please specify the version in the description)
None
A clear and concise description of the bug.
if maximum of a number is double.MaxValue, parsing fails since it is too large for decimal (used in the max/min keyword implementation).
What did you expect?
Looks like any exponential floating point should be allowed as per json-schema.org, hence parsing should not fail.
Please add test code or steps to reproduce the behavior.
JsonSchema fails to parse
"Double": {
"$id": "http://somethingsomething/#Double",
"title": "Type Double",
"type": "number",
"minimum": -1.7976931348623157E+308,
"maximum": 1.7976931348623157E+308,
"default": 0
}
Is there any other information you'd like to share regarding this bug?
No response
Code of Conduct & Contributor Guidelines
The text was updated successfully, but these errors were encountered: