-
-
Notifications
You must be signed in to change notification settings - Fork 296
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
Correct number of primitive types from seven to six. #145
Conversation
The core spec lists six primitive types in section 4.2 (null, boolean, object, array, number, string), but this sentence claims there are seven. Correct it to match.
Alternatively |
Just adding |
@@ -552,7 +552,7 @@ | |||
an array, elements of the array MUST be strings and MUST be unique. | |||
</t> | |||
<t> | |||
String values MUST be one of the seven primitive types defined by | |||
String values MUST be one of the six primitive types defined by |
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.
Should the
Recall: "number" includes "integer".
bit on line 560 also be removed? Since there is no longer an "integer" primitive type, that sentence is a bit confusing.
@epoberezkin "integer" was removed from the types in core, so if it's referenced anywhere else in validation that is also a bug and should be cleaned up. Or we need to restore it to the list in core, but I think @awwright wanted to stay with the actual JSON primitive types instead. |
What is the motivation to remove "integer" from validation types? When/where was it discussed? |
@epoberezkin - @awwright removed it at some point, presumably before I was here as I don't recall any issue or discussion. I'm in favor of "integer" as it is an extremely common case and annoying to do with multipleOf and/or a $ref. I just had not gotten around to asking what happened to it. If we are getting rid of integer, it's still used in an example in the core spec so that should be fixed, too. |
All such changes will eventually lead to the fragmentation of what the standard means and as the result some other standard will be developed. None of the validators is going to drop the support of integers. And yet the standard will not have it. That's ridiculous even as proposal, leave alone as a change that happened without any discussion. |
@epoberezkin I'm with you on this |
I think the idea is there's six primitive types, as far as parsing data is concerned; however in the "type" keyword you can also list "integer" which is a subset of "number" (any number with a zero fractional part). |
The removal of "integer" was a point of confusion for me. Can a line be added to the change log to note that "integer" was removed? |
Thanks for the clarification. |
#147 describes the intended behavior so I'll close this out. If there's any further problems please feel free to open a new issue! |
The core spec lists six primitive types in section 4.2 (null, boolean, object, array, number, string), but this sentence claims there are seven. Correct it to match.
I'm not sure if this is the right fix - it's also possible that seven is correct, but the reference to the core spec is wrong. Presumably "integer" is meant to be allowed here too - but the type "integer" is nowhere defined - not in the core spec, or the validation spec.