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
Where in this case details is of map[string]*big.Rat and its a is initialized to nil and b is initialized to nil as well. Reading big.Rat's doc seems like when b is nil, it will string() into 1.
This is true if minimum is set to 1, or any other number. The error msg will be: x: Must be greater than or equal to <whatever the min>/1'.
The trailing /1 is very confusing.
The text was updated successfully, but these errors were encountered:
Internally the numbers are stored as big.Rat, which allows for infinite precision which prevents rounding errors when using multipleOf. However in the output they should've been converted to big.Float which would automatically have the proper string representation in the output (without the ugly /1). However there are a few places where I forgot to do that conversion in #224.
The fix itself looks rather easy, but now that I'm looking at it there are a few more number related things I want to take a look at before merging a fix.
version:
github.com/xeipuuv/gojsonschema v1.1.0
schema:
json:
The error msg:
.... x: Must be greater than or equal to 0/1'.
I suspect the issue comes from this line:
Where in this case
details
is ofmap[string]*big.Rat
and itsa
is initialized to nil andb
is initialized to nil as well. Reading big.Rat's doc seems like when b is nil, it will string() into 1.This is true if
minimum
is set to 1, or any other number. The error msg will be:x: Must be greater than or equal to <whatever the min>/1'.
The trailing
/1
is very confusing.The text was updated successfully, but these errors were encountered: