-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
clean up $dynamic*
#1555
Open
gregsdennis
wants to merge
13
commits into
main
Choose a base branch
from
gregsdennis/dynamic-ref
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
clean up $dynamic*
#1555
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c53747f
clean up $dyanmic*
gregsdennis b0ece6e
clarfication around $dynamicAnchor and its separation from $ref seman…
gregsdennis dcb6ee4
Update specs/jsonschema-core.md
gregsdennis 0ab9b7a
Update specs/jsonschema-core.md
gregsdennis 5899a3e
Update specs/jsonschema-core.md
gregsdennis a75cbce
Update specs/jsonschema-core.md
gregsdennis 8dbcd11
update note about hyper-schema as an example
gregsdennis 5cddc41
update format adr
gregsdennis f2c98cb
update adr formatting again
gregsdennis 54f15de
footnotes need a colon
gregsdennis 48b346b
apparently the footnote needs to be at the end for this file
gregsdennis 1edbad0
removed IRI language from $dynamicRef passages
gregsdennis eec2c4c
update year on ietf specs
gregsdennis 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 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 |
---|---|---|
@@ -1,78 +1,101 @@ | ||
# [short title of solved problem and solution] | ||
# `format` as an assertion | ||
|
||
* Status: proposed | ||
- Status: proposed | ||
<!-- will update below to only those who participated in the vote --> | ||
* Deciders: @gregsdennis @jdesrosiers @julian @jviotti @mwadams @karenetheridge @relequestual | ||
* Date: 2024-11-02 | ||
* Technical Story: https://github.com/json-schema-org/json-schema-spec/issues/1520 | ||
* Voting issue: https://github.com/json-schema-org/TSC/issues/19 | ||
For - @gregsdennis @jdesrosiers @jviotti @mwadams @karenetheridge | ||
Neutral - @relequestual | ||
Against - @julian | ||
- Deciders: @gregsdennis @jdesrosiers @julian @jviotti @mwadams @karenetheridge | ||
@relequestual | ||
- Date: 2024-11-02 | ||
- Technical Story: <https://github.com/json-schema-org/json-schema-spec/issues/1520> | ||
- Voting issue: <https://github.com/json-schema-org/TSC/issues/19> | ||
- For - @gregsdennis @jdesrosiers @jviotti @mwadams @karenetheridge | ||
- Neutral - @relequestual | ||
- Against - @julian | ||
|
||
## Context and Problem Statement | ||
|
||
There's a long and sticky history around format. | ||
|
||
1. Going back all the way to Draft 01, format has never required validation. | ||
2. Whether to support format validation has always been the decision of the implementation. | ||
3. The extent to which formats are validated has also been the decision of the implementation. | ||
|
||
The result of all of this is that implementation support for validation has been spotty at best. Despite the JSON Schema specs referencing very concretely defined formats (by referencing other specs), implementations that do support validation don't all support each format equally. This has been the primary driving force behind keeping format as an opt-in validation. | ||
|
||
With 2019-09, we decided that it was time to give the option of format validation to the schema author. They could enable validation by using a meta-schema which listed the Format Vocabulary with a true value, which meant, "format validation is required to process this schema." | ||
|
||
In 2020-12, we further refined this by offering two separate vocabularies, one that treats the keyword as an annotation and one that treats it as an assertion. The argument was that the behavior of a keyword shouldn't change based on whether the vocabulary was required or not. | ||
|
||
However, the fact remains that our users consistently report (via questions in Slack, GitHub, and StackOverflow) that they expect format to validate. (The most recent case I can think of was only last week, in .Net's effort to build a short-term solution for schema generation from types.) | ||
1. Whether to support format validation has always been the decision of the | ||
implementation. | ||
1. The extent to which formats are validated has also been the decision of the | ||
implementation. | ||
|
||
The result of all of this is that implementation support for validation has been | ||
spotty at best. Despite the JSON Schema specs referencing very concretely | ||
defined formats (by referencing other specs), implementations that do support | ||
validation don't all support each format equally. This has been the primary | ||
driving force behind keeping format as an opt-in validation. | ||
|
||
With 2019-09, we decided that it was time to give the option of format | ||
validation to the schema author. They could enable validation by using a | ||
meta-schema which listed the Format Vocabulary with a true value, which meant, | ||
"format validation is required to process this schema." | ||
|
||
In 2020-12, we further refined this by offering two separate vocabularies, one | ||
that treats the keyword as an annotation and one that treats it as an assertion. | ||
The argument was that the behavior of a keyword shouldn't change based on | ||
whether the vocabulary was required or not. | ||
|
||
However, the fact remains that our users consistently report (via questions in | ||
Slack, GitHub, and StackOverflow) that they expect format to validate. (The most | ||
recent case I can think of was only last week, in .Net's effort to build a | ||
short-term solution for schema generation from types.) | ||
|
||
Due to this consistency in user expectations, we have decided to: | ||
|
||
1. make format an assertion keyword, and | ||
2. strictly enforce it by moving the appropriate tests into the required section of the Test Suite and building them more completely. | ||
1. strictly enforce it by moving the appropriate tests into the required section | ||
of the Test Suite and building them more completely. | ||
|
||
## Decision Drivers | ||
|
||
* User expectation | ||
* Current behavior | ||
* Historical context | ||
* Disparity of current implementation support vs the proposed requirements | ||
- User expectation | ||
- Current behavior | ||
- Historical context | ||
- Disparity of current implementation support vs the proposed requirements | ||
|
||
## Considered Options | ||
|
||
### `format` remains an annotation keyword by default | ||
|
||
This is the current state. The primary benefit is that we don't need to make a breaking change. | ||
|
||
The primary downside is that the current system of (1) configuring the tool or (2) incluing the `format-assertion` vocab[^1] is confusing for many and doesn't align with user expectations. | ||
This is the current state. The primary benefit is that we don't need to make a | ||
breaking change. | ||
|
||
[^1] The `format-assertion` vocabulary will no longer be an option since we have demoted vocabularies to a proposal for the stable release. This leaves tool configuration as the only option to enable `format` validation. | ||
The primary downside is that the current system of (1) configuring the tool or | ||
(2) incluing the `format-assertion` vocab[^1] is confusing for many and doesn't | ||
align with user expectations. | ||
|
||
### `format` becomes an assertion keyword by default | ||
|
||
We change the spec to require `format` validation. Furthermore: | ||
We change the spec to require `format` validation. Furthermore: | ||
|
||
* Implementations SHOULD support `format` with the defined values | ||
* Implementations MAY support others, but only by explicit config | ||
* Implementations MUST refuse to process a schema that contains an unsupported format | ||
- Implementations SHOULD support `format` with the defined values | ||
- Implementations MAY support others, but only by explicit config | ||
- Implementations MUST refuse to process a schema that contains an unsupported | ||
format | ||
|
||
## Decision Outcome | ||
|
||
The TSC has decided via vote (see voting issue above) that we should change `format` to act as an assertion by default, in line with option (2). | ||
The TSC has decided via vote (see voting issue above) that we should change | ||
`format` to act as an assertion by default, in line with option (2). | ||
|
||
### Positive Consequences <!-- optional --> | ||
|
||
* Aligns with user expectations. | ||
* Users are still able to have purely annotative behavior through use of something like `x-format`. | ||
* Increased consistency for `format` validation across implementations. | ||
- Aligns with user expectations. | ||
- Users are still able to have purely annotative behavior through use of | ||
something like `x-format`. | ||
- Increased consistency for `format` validation across implementations. | ||
|
||
### Negative Consequences <!-- optional --> | ||
|
||
* This is a breaking change, which means that we will likely have to re-educate the users who correctly treat it as an annotation. | ||
* Older schemas which do not specify a version (`$schema`) may change their validation outcome. | ||
* The burden on implementations will be greater since format validation was previously optional. | ||
|
||
## Links <!-- optional --> | ||
- This is a breaking change, which means that we will likely have to re-educate | ||
the users who correctly treat it as an annotation. | ||
- Older schemas which do not specify a version (`$schema`) may change their | ||
validation outcome. | ||
- The burden on implementations will be greater since format validation was | ||
previously optional. | ||
|
||
* [Link type] [Link to ADR] <!-- example: Refined by [ADR-0005](0005-example.md) --> | ||
* … <!-- numbers of links can vary --> | ||
[^1]: The `format-assertion` vocabulary will no longer be an option since we | ||
have demoted vocabularies to a proposal for the stable release. This leaves tool | ||
configuration as the only option to enable `format` validation. |
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
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.
This is a different ADR and shouldn't be changing in this PR?
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.
There were some formatting things that were merged and failing on the main branch and causing this build to fail. Jason and I just cleaned it up here.