go-jsonschema
go-jsonschema copied to clipboard
Add minimum and maximum validations
Still needed to test some edge cases like float precisions and integer validations. Too late today >.<
There are two different things to note at that point:
1- Blocked since I can't print to the file the character % for the multipleOf validation
2- Found a bug on my PR itself where multiple number validations can't be applied at once
Now there is just the issue with the % sign and spaces on its sides.
Don't know how to solve it.
cc/ @atombender
@jmaeso I'm interested in merging this if you could maybe rebase it from master?
I was testing after applying the rebase and got some issues. When reviewing the errors actually realized that master tests are not passing for me (suffix -Json is being added in all the generated structs and looks like it's not the expected behaviour). Since my code is like 1 year old now I would feel more confident if master gets fixed first in order to continue the rebase.
In case I am the only one experiencing the issue, I'm running go version go1.15.8 darwin/amd64
Implementation updated @atombender . Actually looks like I didn't need the % operator...
TIL % operator does not support floats: https://play.golang.org/p/H3yaNpKbJhu
ps: feel free to require a different implementation strategy
Oh, incidentally I happened to hack on primitive validation too last night without noticing this, my approach is in #21 (only maximum/exclusiveMaximum done for now, but should be mostly trivial to add the rest). No personal preferences as to which approach to adopt as long as one is merged :) Will leave a few comments here.
I am closing this PR as it's become stale, and we'll likely review the whole validation system in the future.