-
Notifications
You must be signed in to change notification settings - Fork 553
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
schema: Drop pointers and nulls #662
Merged
Merged
+36
−144
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is part duplicated with #545 |
Ah, yup. Happy to rebase if that lands first. |
Maintainers feel (and I agree) that there's no point in explicitly allowing a null value when callers can simply leave the property unset [1]. This commit removes all references to "pointer" and "null" from the JSON Schema to support that decision. While optional properties may sometimes be represented as pointer types in Go [2], optional properties should be represented in JSON Schema by not including the properties in the 'required' array. [1]: opencontainers#555 (comment) [2]: style.md "Optional settings should not have pointer Go types" Signed-off-by: W. Trevor King <wking@tremily.us>
wking
force-pushed
the
json-schema-no-pointer
branch
from
January 23, 2017 19:26
b554d2e
to
0927437
Compare
Reviewed looks good. |
1 similar comment
wking
added a commit
to wking/opencontainer-runtime-spec
that referenced
this pull request
May 11, 2017
Catch the Markdown spec up with the JSON Schema change in 0927437 (schema: Drop pointers and nulls, 2017-01-18, opencontainers#662). The Markdown is canonical, so we could restore the explicit-null handling to the JSON Schema instead, but the maintainers feel (and I agree) that there's no point in explicitly allowing a null value when callers can simply leave the property unset [1]. [1]: opencontainers#555 (comment) Signed-off-by: W. Trevor King <wking@tremily.us>
wking
added a commit
to wking/opencontainer-runtime-spec
that referenced
this pull request
May 11, 2017
Catch the Markdown spec up with the JSON Schema change in 0927437 (schema: Drop pointers and nulls, 2017-01-18, opencontainers#662). The Markdown is canonical, so we could restore the explicit-null handling to the JSON Schema instead, but the maintainers feel (and I agree) that there's no point in explicitly allowing a null value when callers can simply leave the property unset [1]. [1]: opencontainers#555 (comment) Signed-off-by: W. Trevor King <wking@tremily.us>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Maintainers feel (and I agree) that there's no point in explicitly allowing a null value when callers can simply leave the property unset. This commit removes all references to “pointer” and “null” from the JSON Schema to support that decision. While optional properties may sometimes be represented as pointer types in Go, optional properties should be represented in JSON Schema by not including the properties in the
required
array.Spun off from this comment as requested by @RobDolinMS.