-
-
Notifications
You must be signed in to change notification settings - Fork 307
extract propertyDependencies
#1450
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
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7451b3d
unfinished proposal; add to build
gregsdennis f78805c
normalize header; ignore built html file
gregsdennis eeb57ce
remove hints from proposal section
gregsdennis f3e23b2
Update the build process to support more files
jdesrosiers b6f9430
Fill in missing sections of propDeps proposal and refactor
jdesrosiers 0b1a71a
PropDeps: Fix typos and other cleanup
jdesrosiers be32290
Update dependencies
jdesrosiers 646368d
Fix bug in build and remove duplication
jdesrosiers ee05932
PropDeps: Split into two documents
jdesrosiers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# JSON Schema Extension: The `propertyDependencies` Keyword | ||
|
||
## Abstract | ||
|
||
The `propertyDependencies` keyword is a more friendly way to select between two | ||
or more schemas to validate an instance against than is currently supported by | ||
JSON Schema. | ||
|
||
## Status | ||
|
||
**Current Status**: EXPERIMENTAL | ||
|
||
This extension is in the early stages of development. Changes, including | ||
breaking changes, are possible. At this stage, it's recommended that | ||
implementations disable this keyword by default. | ||
|
||
This extension has been | ||
[proposed](https://github.com/json-schema-org/json-schema-spec/blob/main/proposals/propertyDependencies.md) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here you're linking to the file in GH... |
||
for inclusion as a standard keyword in the JSON Schema specification. | ||
|
||
## Note to Readers | ||
|
||
The issues list for this extension can be found at | ||
<https://github.com/json-schema-org/json-schema-spec/issues?q=is%3Aissue+propertydependencies>. | ||
|
||
For additional information, see <https://json-schema.org/>. | ||
|
||
To provide feedback, use this issue tracker or any of the communication methods | ||
listed on the homepage. | ||
|
||
## Table of Contents | ||
|
||
## Conventions and Terminology | ||
|
||
All conventions and terms used and defined by the [JSON Schema Core | ||
specification](../jsonschema-core.html) also apply to this document. | ||
|
||
## Extension | ||
|
||
This document adds the `propertyDependencies` keyword to the | ||
`https://json-schema.org/vocab/applicator` [applicator | ||
vocabulary](../jsonschema-core.html#applicatorvocab). | ||
|
||
### `propertyDependencies` | ||
|
||
This keyword specifies subschemas that are evaluated if the instance is an | ||
object and contains a certain property with a certain string value. | ||
|
||
This keyword's value MUST be an object. Each value in the object MUST be an | ||
object whose values MUST be valid JSON Schemas. | ||
|
||
If the outer object key is a property in the instance and the inner object key | ||
is equal to the value of that property, the entire instance must validate | ||
against the schema. Its use is dependent on the presence and value of the | ||
property. | ||
|
||
Omitting this keyword has the same behavior as an empty object. | ||
|
||
## [Appendix] Change Log | ||
|
||
* [October 2023] Created | ||
|
||
## Champions | ||
|
||
| Champion | Company | Email | URI | | ||
|----------------------------|---------|----------------------|----------------------------------| | ||
| Jason Desrosiers | Postman | <[email protected]> | <https://github.com/jdesrosiers> | |
This file contains hidden or 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
Oops, something went wrong.
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.
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.
I expect at some point we'd move this to some sort of "statuses" document (or section in a larger process document). I don't think a definition of what the "EXPERIMENTAL" status generally needs to be included for these.
As we don't yet have such a document, I think having this is fine.
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.
I forgot to explain what I was thinking here. I'm not sure it makes sense. I was just trying it out.
I expect that the concept of a proposal being a proposal to adopt an extension wouldn't be limited to our extensions. Some third-party may define an extension spec in whatever form they choose with their own ideas about the status of the document. So, the extension spec's status is a different concept than the proposal process status. I thought, "what would I put here if this was just a standalone third-party spec and the proposal process wasn't involved?"
While I might use a status like "EXPERIMENTAL" while the spec is third-party, I'd probably switch to something like "Proposed Standard" when it enters the proposal process. So, what I did doesn't quite makes sense. It's kind of half way in two places.
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.
All that is whatever. It needs to be defined, and I'm just saying a document like this only needs to point to wherever that ends up being defined. It doesn't need to copy any text. It should just say, "This is my status. For more info about statuses, click here."