-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Values for section 6.2 should be numbers #100
Conversation
@samlown it's ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! Looks great from the outset. I've added a few questions regarding the use of pointers... I'm not convinced they're necessary, and if they are, there should be some tests to show it.
@samlown review comments addressed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
@@ -1020,6 +1016,19 @@ func ignoredByJSONSchemaTags(tags []string) bool { | |||
return tags[0] == "-" | |||
} | |||
|
|||
// toJSONNumber converts string to *json.Number. | |||
// It'll aso return whether the number is valid. | |||
func toJSONNumber(s string) (json.Number, bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure the bool
is necessary given that you can test for an empty number, but we can go with that.
@samlown could you merge & release 0.9.1? |
New release pushed. Thanks. |
Closes #98
Closes #99
https://json-schema.org/draft/2020-12/json-schema-validation.html#section-6.2