-
-
Notifications
You must be signed in to change notification settings - Fork 377
Added migration page overview #1061
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
base: main
Are you sure you want to change the base?
Conversation
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1061 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 373 396 +23
Branches 94 106 +12
=========================================
+ Hits 373 396 +23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Juan Cruz Viotti <[email protected]>
Co-authored-by: Juan Cruz Viotti <[email protected]>
jdesrosiers
left a comment
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 found a few errors in the table. But, also there are several cases that are quite complicated. Hopefully my suggestions fill in some of that history. Feel free to express any of the complicated cases however you see best. My suggestions are just suggestions. If you want to ignore some of the chaos in name of simplifying things a bit, I'm ok with that.
Co-authored-by: Jason Desrosiers <[email protected]>
Co-authored-by: Jason Desrosiers <[email protected]>
Co-authored-by: Jason Desrosiers <[email protected]>
Co-authored-by: Jason Desrosiers <[email protected]>
Co-authored-by: Jason Desrosiers <[email protected]>
Co-authored-by: Jason Desrosiers <[email protected]>
Co-authored-by: Jason Desrosiers <[email protected]>
Co-authored-by: Jason Desrosiers <[email protected]>
| | `maxContains` | Validation | 2019-09 | No | No | | ||
| | `maxDecimals` | Validation | 01 | Yes | Replaced by `divisibleBy` | | ||
| | `maxProperties` | Validation | 04 | No | No | |
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 noticed maxItems and minItems are missing entirely in this PR. They've always existed since draft-01 and have never changed.
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.
updated
|
|
||
| | Keyword (Draft-04) | Keyword (Draft-06) | Specification | Keyword Type | Behavior Details | | ||
| | ------------------------------------------------ | ----------------------------------------------- | ------------- | ------------------ | ------------------------------------------------------------------------------------------- | | ||
| | `id` | `$id` | Core | Identifier | Replaces `id` with `$id` to align with JSON-LD and emphasize its identifier role. | |
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 don't think the JSON-LD reference here is valid. We don't care about JSON-LD at all and that was not the reason for the $ prefix. This was before me (so might be worth checking with other TSC members), but I believe it was done to more clearly group fundamental keywords together (like $schema)
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 can confirm that this change had nothing to do with JSON-LD. That doesn't even make sense because JSON-LD uses @id, not $id.
This was done to make it consistent with the naming of the other core keywords $schema and $ref. Unfortunately, there was no good reason for this change. It was purely cosmetic.
| | ------------------------------------------------ | ----------------------------------------------- | ------------- | ------------------ | ------------------------------------------------------------------------------------------- | | ||
| | `id` | `$id` | Core | Identifier | Replaces `id` with `$id` to align with JSON-LD and emphasize its identifier role. | | ||
| | `exclusiveMinimum`, `exclusiveMaximum` (boolean) | `exclusiveMinimum`, `exclusiveMaximum` (number) | Validation | Numeric Boundaries | Previously booleans tied to `minimum`/`maximum`; now standalone numeric values. | | ||
| | `definitions` | `definitions` | Core | Schema Reuse | Still available but less emphasized in later drafts in favor of `$defs` (introduced 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'm not sure about this one. $defs was introduced in 2019-09. Not sure we want to mention it at all here
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'm sure. This 100% doesn't belong here.
| | *not present* | `$vocabulary` | Core | Identifier | Declares which vocabularies a schema uses. Enables modular extensibility. | | ||
| | *not present* | `$recursiveRef` | Core | Identifier | Replaces `$ref` in recursive contexts. | | ||
| | *not present* | `$recursiveAnchor` | Core | Identifier | Used in base schemas to define recursive entry points. | | ||
| | `definitions` | `definitions` | Validation | Object Container | Still supported but now superseded by `$defs` in 2020-12+. | |
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 don't think the spec mentions definitions at all. We should suggest $defs. Also $defs was introduced in 2019-09 and not 2020-12 as this page says
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.
Saying it's still supported isn't technically correct. It will accidentally work in most cases, but we should definitely not be telling people it's supported. Just tell people the change the name to $defs.
| | *not present* | `$recursiveRef` | Core | Identifier | Replaces `$ref` in recursive contexts. | | ||
| | *not present* | `$recursiveAnchor` | Core | Identifier | Used in base schemas to define recursive entry points. | | ||
| | `definitions` | `definitions` | Validation | Object Container | Still supported but now superseded by `$defs` in 2020-12+. | | ||
| | `id` | `$id` | Core | Identifier | Already introduced in Draft 6, still used in Draft 2019-09. | |
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 don't think this is correct. Starting on Draft 6, only $id is supported
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.
It's wrong that the name changed, but there was a change to $id in 2019-09 that should be described in this entry. The change was splitting out schema identification and anchor identification.
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.
And id existed before draft 6.
| | `definitions` | `definitions` | Validation | Object Container | Still supported but now superseded by `$defs` in 2020-12+. | | ||
| | `id` | `$id` | Core | Identifier | Already introduced in Draft 6, still used in Draft 2019-09. | | ||
| | `examples` | `examples` | Annotation | Informational | Remains unchanged. | | ||
| | `readOnly` / `writeOnly` | `readOnly` / `writeOnly` | Annotation | Informational | Remains unchanged. | |
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.
Here we mention two keywords in one row, whereas I think before we always broke things in multiple rows (like for if/then/else). Let's be consistent across pages?
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.
Better yet, remove it and examples because this is a change log and nothing about those three keywords has changed.
|
|
||
|
|
||
|
|
||
| #### Step 3: Use `$recursiveAnchor` and `$recursiveRef` for recursive structures |
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'm not sure the example here really exemplifies dynamic referencing. It is not just about recursive structures but about generic/templated schemas. That said, it's a bit hard to exemplify that well here. I remember Greg wrote a blog post about this. Maybe worth just linking to that?
|
|
||
| #### Step 4: Continue using supported keywords like `readOnly`, `writeOnly`, `examples` | ||
|
|
||
| These keywords remain valid and unchanged: |
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.
With the exception that they now emit annotations, which was not the case before
jdesrosiers
left a comment
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.
Here's a partial review. It covers the overview and the 2020-12 migration, plus some responses to Juan's comments. I'll review the rest later.
In addition to the inline comments, please note that the following keywords are missing from the main overview: minimum, maximum, minLength, and maxLength.
|
|
||
| | Keyword (Draft-04) | Keyword (Draft-06) | Specification | Keyword Type | Behavior Details | | ||
| | ------------------------------------------------ | ----------------------------------------------- | ------------- | ------------------ | ------------------------------------------------------------------------------------------- | | ||
| | `id` | `$id` | Core | Identifier | Replaces `id` with `$id` to align with JSON-LD and emphasize its identifier role. | |
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 can confirm that this change had nothing to do with JSON-LD. That doesn't even make sense because JSON-LD uses @id, not $id.
This was done to make it consistent with the naming of the other core keywords $schema and $ref. Unfortunately, there was no good reason for this change. It was purely cosmetic.
| | ------------------------------------------------ | ----------------------------------------------- | ------------- | ------------------ | ------------------------------------------------------------------------------------------- | | ||
| | `id` | `$id` | Core | Identifier | Replaces `id` with `$id` to align with JSON-LD and emphasize its identifier role. | | ||
| | `exclusiveMinimum`, `exclusiveMaximum` (boolean) | `exclusiveMinimum`, `exclusiveMaximum` (number) | Validation | Numeric Boundaries | Previously booleans tied to `minimum`/`maximum`; now standalone numeric values. | | ||
| | `definitions` | `definitions` | Core | Schema Reuse | Still available but less emphasized in later drafts in favor of `$defs` (introduced 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'm sure. This 100% doesn't belong here.
| | *not present* | `$vocabulary` | Core | Identifier | Declares which vocabularies a schema uses. Enables modular extensibility. | | ||
| | *not present* | `$recursiveRef` | Core | Identifier | Replaces `$ref` in recursive contexts. | | ||
| | *not present* | `$recursiveAnchor` | Core | Identifier | Used in base schemas to define recursive entry points. | | ||
| | `definitions` | `definitions` | Validation | Object Container | Still supported but now superseded by `$defs` in 2020-12+. | |
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.
Saying it's still supported isn't technically correct. It will accidentally work in most cases, but we should definitely not be telling people it's supported. Just tell people the change the name to $defs.
| | *not present* | `$recursiveRef` | Core | Identifier | Replaces `$ref` in recursive contexts. | | ||
| | *not present* | `$recursiveAnchor` | Core | Identifier | Used in base schemas to define recursive entry points. | | ||
| | `definitions` | `definitions` | Validation | Object Container | Still supported but now superseded by `$defs` in 2020-12+. | | ||
| | `id` | `$id` | Core | Identifier | Already introduced in Draft 6, still used in Draft 2019-09. | |
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.
It's wrong that the name changed, but there was a change to $id in 2019-09 that should be described in this entry. The change was splitting out schema identification and anchor identification.
| | `definitions` | `definitions` | Validation | Object Container | Still supported but now superseded by `$defs` in 2020-12+. | | ||
| | `id` | `$id` | Core | Identifier | Already introduced in Draft 6, still used in Draft 2019-09. | | ||
| | `examples` | `examples` | Annotation | Informational | Remains unchanged. | | ||
| | `readOnly` / `writeOnly` | `readOnly` / `writeOnly` | Annotation | Informational | Remains unchanged. | |
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.
Better yet, remove it and examples because this is a change log and nothing about those three keywords has changed.
jdesrosiers
left a comment
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 don't think the migration notes for each release are working out. They still need a lot of work to fix errors and include enough detail to be useful. They're nowhere near ready to replace the release notes.
I suggest narrowing the scope of this PR. Let's just do the overview for now with links to the existing release notes. Then we can figure out what to do for the individual migration guides separately.
Co-authored-by: Jason Desrosiers <[email protected]>
Co-authored-by: Jason Desrosiers <[email protected]>
Co-authored-by: Jason Desrosiers <[email protected]>
Co-authored-by: Jason Desrosiers <[email protected]>
Co-authored-by: Jason Desrosiers <[email protected]>
Hello @jdesrosiers do you think the current overview is not accurate as well? I do agree that the migration for specific pages can be better on review now. But if we want to de-scope this to the overview only, are we not there? |
|
I think the overview is mostly fine except you still haven't addressed #1061 (review) ...
|
What kind of change does this PR introduce?
Documentation
Issue Number:
This is the overview page for Migration, which is part of the effort to create an easy transition between dialect upgrades.
Does this PR introduce a breaking change?
No