From 8946f64e497180532568d03a8d0b80f6750e3eac Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe Date: Wed, 17 Jul 2024 22:31:28 +0100 Subject: [PATCH 01/35] Spec draft fixes --- components/Sidebar.tsx | 76 ++++---- pages/draft-07/json-schema-release-notes.md | 123 +++++++------ pages/draft/2019-09/index.md | 46 +++++ pages/draft/2019-09/index.page.tsx | 46 +++++ pages/draft/2019-09/release-notes.md | 187 ++++++++++---------- pages/draft/2020-12/[slug].page.tsx | 39 ---- pages/draft/2020-12/index.md | 41 +++++ pages/draft/2020-12/index.page.tsx | 46 +++++ pages/draft/2020-12/release-notes.md | 59 +++--- pages/format4/body.md | 2 + pages/format4/index.md | 6 + pages/format4/index.page.tsx | 45 +++++ 12 files changed, 472 insertions(+), 244 deletions(-) create mode 100644 pages/draft/2019-09/index.md create mode 100644 pages/draft/2019-09/index.page.tsx delete mode 100644 pages/draft/2020-12/[slug].page.tsx create mode 100644 pages/draft/2020-12/index.md create mode 100644 pages/draft/2020-12/index.page.tsx create mode 100644 pages/format4/body.md create mode 100644 pages/format4/index.md create mode 100644 pages/format4/index.page.tsx diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index cfec6dc8a..ecd6f0cff 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -647,54 +647,60 @@ export const DocsNav = ({ id='specification' > - +
+ + + + + + +
+ + + - - + - -
- - - -
+ /> + diff --git a/pages/draft-07/json-schema-release-notes.md b/pages/draft-07/json-schema-release-notes.md index 5d4fcbc89..e13e7f0f7 100644 --- a/pages/draft-07/json-schema-release-notes.md +++ b/pages/draft-07/json-schema-release-notes.md @@ -3,37 +3,60 @@ title: Draft-07 Release Notes section: docs --- +### Access all data connected to Draft-07 + +- Core: [draft-handrews-json-schema-01](https://json-schema.org/draft-07/draft-handrews-json-schema-01.html) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-01.html#rfc.appendix.B)) +- Validation: [draft-handrews-json-schema-validation-01](https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01.html) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01.html#rfc.appendix.B)) +- Hyper-Schema: [draft-handrews-json-schema-hyperschema-01](https://json-schema.org/draft-07/draft-handrews-json-schema-hyperschema-01.html) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-hyperschema-01.html#rfc.appendix.B)) +- [JSON Schema meta-schema](https://json-schema.org/draft-07/schema) +- [JSON Hyper-Schema meta-schema](https://json-schema.org/draft-07/hyper-schema) +- [JSON Hyper-Schema Link Description Object meta-schema](https://json-schema.org/draft-07/links) +- [JSON Hyper-Schema recommended output schema](https://json-schema.org/draft-07/hyper-schema-output) +- Relative JSON Pointer: [draft-handrews-relative-json-pointer-01](https://tools.ietf.org/html/draft-handrews-relative-json-pointer-01) ([changes](https://tools.ietf.org/html/draft-handrews-relative-json-pointer-01#appendix-B)) +- Published: 19-March-2018 + +#### Obsolete Draft 7 Documents + +_These were updated without changing functionality or meta-schemas due to a few errors and unclear sections._ + +- Core: [draft-handrews-json-schema-00](https://json-schema.org/draft-07/draft-handrews-json-schema-00.pdf) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-00.pdf#appendix-B)) +- Validation: [draft-handrews-json-schema-validation-00](https://json-schema.org/draft-07/draft-handrews-json-schema-validation-00.pdf) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-validation-00.pdf#appendix-B)) +- Hyper-Schema: [draft-handrews-json-schema-hyperschema-00](https://json-schema.org/draft-07/draft-handrews-json-schema-hyperschema-00.html) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-hyperschema-00.html#rfc.appendix.B)) +- Relative JSON Pointer: [draft-handrews-relative-json-pointer-00](https://tools.ietf.org/html/draft-handrews-relative-json-pointer-00) ([changes](https://tools.ietf.org/html/draft-handrews-relative-json-pointer-00#appendix-B)) + +### Draft-07 Release Note + For the Core and Validation specifications, draft-07 is a relatively -minor update. In terms of validation keywords and outcomes, it is fully +minor update. In terms of validation keywords and outcomes, it is fully backwards-compatible with draft-06. Some differences exist with keywords moved over from Hyper-Schema, and with -how instances and schemas are recommended to be linked together. Finally, +how instances and schemas are recommended to be linked together. Finally, the process of collecting annotation keyword values has been defined more clearly than before. -* [Keywords](#keywords) -* [Formats](#formats) -* [Classification of Keywords](#classification-of-keywords) -* [Collecting Annotation Values](#collecting-annotation-values) -* [JSON Schema in Hypermedia Environments](#json-schema-in-hypermedia-environments) - * [Linking Instances and Schemas](#linking-instances-and-schemas) - * [Instance Media Type](#instance-media-type) +- [Keywords](#keywords) +- [Formats](#formats) +- [Classification of Keywords](#classification-of-keywords) +- [Collecting Annotation Values](#collecting-annotation-values) +- [JSON Schema in Hypermedia Environments](#json-schema-in-hypermedia-environments) + - [Linking Instances and Schemas](#linking-instances-and-schemas) + - [Instance Media Type](#instance-media-type) ### Keywords -* No keywords changed behavior -* No keywords were removed -* Some keywords were moved from Hyper-Schema, and two of those were renamed +- No keywords changed behavior +- No keywords were removed +- Some keywords were moved from Hyper-Schema, and two of those were renamed -keyword | change | notes ----- | ---- | ---- -[`"$comment"`](../../draft-07/json-schema-core.html#rfc.section.9) | added to Core | Intended for notes to schema maintainers, as opposed to [`"description"`](../../draft-07/json-schema-validation.html#rfc.section.10.1) which is suitable for display to end users -[`"if"`, `"then"`, `"else"`](../../draft-07/json-schema-validation.html#rfc.section.6.6) | added to Validation | explicit conditional schema evaluation -[`"readOnly"`](../../draft-07/json-schema-validation.html#rfc.section.10.3) | moved from Hyper-Schema to Validation | not limited to hypermedia environments -[`"writeOnly"`](../../draft-07/json-schema-validation.html#rfc.section.10.3) | added to Validation | general write-only fields, including but not limited to passwords -[`"contentMediaType"`](../../draft-07/json-schema-validation.html#rfc.section.8) | moved from Hyper-Schema to Validation | formerly [`"media": {"type": "..."}`](../../draft-06/json-schema-hypermedia.html#rfc.section.5.3) -[`"contentEncoding"`](../../draft-07/json-schema-validation.html#rfc.section.8) | moved from Hyper-Schema to Validation | formerly [`"media": {"binaryEncoding": "..."}`](../../draft-06/json-schema-hypermedia.html#rfc.section.5.3) +| keyword | change | notes | +| ---------------------------------------------------------------------------------------- | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [`"$comment"`](../../draft-07/json-schema-core.html#rfc.section.9) | added to Core | Intended for notes to schema maintainers, as opposed to [`"description"`](../../draft-07/json-schema-validation.html#rfc.section.10.1) which is suitable for display to end users | +| [`"if"`, `"then"`, `"else"`](../../draft-07/json-schema-validation.html#rfc.section.6.6) | added to Validation | explicit conditional schema evaluation | +| [`"readOnly"`](../../draft-07/json-schema-validation.html#rfc.section.10.3) | moved from Hyper-Schema to Validation | not limited to hypermedia environments | +| [`"writeOnly"`](../../draft-07/json-schema-validation.html#rfc.section.10.3) | added to Validation | general write-only fields, including but not limited to passwords | +| [`"contentMediaType"`](../../draft-07/json-schema-validation.html#rfc.section.8) | moved from Hyper-Schema to Validation | formerly [`"media": {"type": "..."}`](../../draft-06/json-schema-hypermedia.html#rfc.section.5.3) | +| [`"contentEncoding"`](../../draft-07/json-schema-validation.html#rfc.section.8) | moved from Hyper-Schema to Validation | formerly [`"media": {"binaryEncoding": "..."}`](../../draft-06/json-schema-hypermedia.html#rfc.section.5.3) | Note that the `"content*"` keywords do not _require_ validation. @@ -41,34 +64,34 @@ Note that the `"content*"` keywords do not _require_ validation. Numerous formats were added, clarified, or restored from older drafts. -format | change | notes ----- | ---- | ---- -[`"iri"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.5) | added | I18N equivalent of `"uri"` -[`"iri-reference"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.5) | added | I18N equivalent of `"uri-reference"` -[`"uri-template"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.6) | noted IRI support | There is no separate IRI Template standard -[`"idn-email"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.2) | added | I18N equivalent of `"email"` -[`"idn-hostname"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.3) | added | I18N equivalent of `"hostname"` -[`"json-pointer"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.7) | clarified | Use for string form only, not URI fragment -[`"relative-json-pointer"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.7) | added | Revived [Relative JSON Pointer](../../draft-07/relative-json-pointer.html) draft -[`"regex"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.8) | restored from draft-03 | ECMA 262 regular expressions -[`"date"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.1) | restored from draft-03 | RFC 3339 "full-date" -[`"time"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.1) | restored from draft-03 | RFC 3339 "full-time" +| format | change | notes | +| ----------------------------------------------------------------------------------------- | ---------------------- | -------------------------------------------------------------------------------- | +| [`"iri"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.5) | added | I18N equivalent of `"uri"` | +| [`"iri-reference"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.5) | added | I18N equivalent of `"uri-reference"` | +| [`"uri-template"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.6) | noted IRI support | There is no separate IRI Template standard | +| [`"idn-email"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.2) | added | I18N equivalent of `"email"` | +| [`"idn-hostname"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.3) | added | I18N equivalent of `"hostname"` | +| [`"json-pointer"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.7) | clarified | Use for string form only, not URI fragment | +| [`"relative-json-pointer"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.7) | added | Revived [Relative JSON Pointer](../../draft-07/relative-json-pointer.html) draft | +| [`"regex"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.8) | restored from draft-03 | ECMA 262 regular expressions | +| [`"date"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.1) | restored from draft-03 | RFC 3339 "full-date" | +| [`"time"`](../../draft-07/json-schema-validation.html#rfc.section.7.3.1) | restored from draft-03 | RFC 3339 "full-time" | All other RFC 3339 date, time, and duration names are reserved for future -consideration. If added as extension formats, they SHOULD be implemented +consideration. If added as extension formats, they SHOULD be implemented in a way that is compatible with their use in the RFC to ensure future compatibility. ### Classification of Keywords While it does not have a direct impact on the validation process, this set -of drafts classifies keywords by their behavior. The names of these +of drafts classifies keywords by their behavior. The names of these classifications are used throughout the documents, so they are useful to know: -* [Applicability](../../draft-07/json-schema-validation.html#rfc.section.3.1) -* [Assertions](../../draft-07/json-schema-validation.html#rfc.section.3.2) -* [Annotations](../../draft-07/json-schema-validation.html#rfc.section.3.3) +- [Applicability](../../draft-07/json-schema-validation.html#rfc.section.3.1) +- [Assertions](../../draft-07/json-schema-validation.html#rfc.section.3.2) +- [Annotations](../../draft-07/json-schema-validation.html#rfc.section.3.3) Note that `definitions` does not fit any of these categories, nor do the dollar-prefixed Core keywords. @@ -79,34 +102,34 @@ dollar-prefixed Core keywords. called [metadata keywords](../../draft-06/json-schema-validation.html#rfc.section.7) now provide guidance on [how to collect multiple values](../../draft-07/json-schema-validation.html#rfc.section.3.3) -that apply to the same location in the instance. By default, all values +that apply to the same location in the instance. By default, all values that are not found within [negated schemas](../../draft-07/json-schema-validation.html#rfc.section.3.3.1) are collected -as an unordered set. The following exceptions are documented under the +as an unordered set. The following exceptions are documented under the approprite keywords: -* `readOnly` and `writeOnly` should be logically ORed -* `examples` should be flattened into a single collected array +- `readOnly` and `writeOnly` should be logically ORed +- `examples` should be flattened into a single collected array ### JSON Schema in Hypermedia Environments These changes are not relevant to many Validation use cases, and are more -of interest to Hyper-Schema users. However, even without Hyper-Schema, +of interest to Hyper-Schema users. However, even without Hyper-Schema, if you are accessing instance documents over HTTP or through other hypermedia environments, you may find this section useful. #### Linking Instances and Schemas After discussions with the author of the "profile" specification, we concluded -that its use for JSON Schema was not correct. The new guidance for +that its use for JSON Schema was not correct. The new guidance for [what relations to use](../../draft-07/json-schema-core.html#rfc.section.11.1) to link instances to schemas is: -link relation | change | notes ----- | ---- | ---- -"describedBy" | no change | network-accessible URL -"profile" | removed; use "schema" | opaque identifying URI -"schema" | added | opaque identifying URI +| link relation | change | notes | +| ------------- | --------------------- | ---------------------- | +| "describedBy" | no change | network-accessible URL | +| "profile" | removed; use "schema" | opaque identifying URI | +| "schema" | added | opaque identifying URI | "schema", like "profile" in past drafts, can also be used as a [media type parameter](../../draft-07/json-schema-core.html#rfc.section.11.2). @@ -118,11 +141,11 @@ Validation, but as they are part of the core specification, they are explained here. Media types determine their own parameters, as well as their own -URI fragment syntax(es). `application/json` does not allow any parameters +URI fragment syntax(es). `application/json` does not allow any parameters or URI fragments. [`application/schema-instance+json`](../../draft-07/json-schema-core.html#rfc.section.4.2.2) - is an optional media type for use with instances that supports "schema" +is an optional media type for use with instances that supports "schema" as a media type parameter, and allows for URI fragments using the JSON Pointer syntax. diff --git a/pages/draft/2019-09/index.md b/pages/draft/2019-09/index.md new file mode 100644 index 000000000..d579813b8 --- /dev/null +++ b/pages/draft/2019-09/index.md @@ -0,0 +1,46 @@ +--- +title: Draft 2019-09 +section: docs +Specification: https://json-schema.org/draft/2020-12/json-schema-core.html +Authors: + - Austin Wright + - Henry Andrews + - Ben Hutton + - Greg Dennis +Published: 16 June 2022 +Metaschema: https://json-schema.org/draft/2020-12/schema +Implementations: https://bowtie.report/#/dialects/draft2020-12 +Status: Stable +--- + +### Introduction + +[Placeholder text] + +### Access all data connected to draft 2019-09 + +**\*NOTE:** All meta-schema URIs now use `https://`. While currently also available over plain HTTP due to the limitations of GitHub pages and the need to keep prior drafts available over HTTP, only the HTTPS URIs should be used.\* + +- Specifications + - Core: [draft-handrews-json-schema-02](https://json-schema.org/draft/2019-09/draft-handrews-json-schema-02.html) ([changes](https://json-schema.org/draft/2019-09/draft-handrews-json-schema-02.html#rfc.appendix.G)) + - Validation: [draft-handrews-json-schema-validation-02](https://json-schema.org/draft/2019-09/draft-handrews-json-schema-validation-02.html) ([changes](https://json-schema.org/draft/2019-09/draft-handrews-json-schema-validation-02.html#rfc.appendix.C)) + - Hyper-Schema: [draft-handrews-json-schema-hyperschema-02](https://json-schema.org/draft/2019-09/draft-handrews-json-schema-hyperschema-02.html) ([changes](https://json-schema.org/draft/2019-09/draft-handrews-json-schema-hyperschema-02.html#rfc.appendix.B)) + - Relative JSON Pointer: [draft-handrews-relative-json-pointer-02](https://tools.ietf.org/html/draft-handrews-relative-json-pointer-02) ([changes](https://tools.ietf.org/html/draft-handrews-relative-json-pointer-02#appendix-A)) + - Published: 17-September-2019 +- General use meta-schemas + - [JSON Schema meta-schema](https://json-schema.org/draft/2019-09/schema) + - [JSON Hyper-Schema meta-schema](https://json-schema.org/draft/2019-09/hyper-schema) + - [JSON Hyper-Schema Link Description Object meta-schema](https://json-schema.org/draft/2019-09/links) +- Individual vocabulary meta-schemas + - [Core Vocabulary meta-schema](https://json-schema.org/draft/2019-09/meta/core) + - [Applicator Vocabulary meta-schema](https://json-schema.org/draft/2019-09/meta/applicator) + - [Validation Vocabulary meta-schema](https://json-schema.org/draft/2019-09/meta/validation) + - [Format Vocabulary meta-schema](https://json-schema.org/draft/2019-09/meta/format) + - [Content Vocabulary meta-schema](https://json-schema.org/draft/2019-09/meta/content) + - [Meta-Data Vocabulary meta-schema](https://json-schema.org/draft/2019-09/meta/meta-data) + - [Hyper-Schema Vocabulary meta-schema](https://json-schema.org/draft/2019-09/meta/hyper-schema) +- Output schemas + - [JSON Schema recommended output schema](https://json-schema.org/draft/2019-09/output/schema) + - [JSON Hyper-Schema recommended output schema](https://json-schema.org/draft/2019-09/output/hyper-schema) +- Output examples + - [JSON Schema verbose output example](https://json-schema.org/draft/2019-09/output/verbose-example) diff --git a/pages/draft/2019-09/index.page.tsx b/pages/draft/2019-09/index.page.tsx new file mode 100644 index 000000000..719e4f700 --- /dev/null +++ b/pages/draft/2019-09/index.page.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import { getLayout } from '~/components/SiteLayout'; +import fs from 'fs'; +import matter from 'gray-matter'; +import StyledMarkdown from '~/components/StyledMarkdown'; +import { SectionContext } from '~/context'; + +export async function getStaticProps() { + const index = fs.readFileSync('pages/draft/2019-09/index.md', 'utf-8'); + const main = fs.readFileSync('pages/draft/2019-09/release-notes.md', 'utf-8'); + const { content: indexContent, data: indexData } = matter(index); + const { content: bodyContent } = matter(main); + + const frontmatter = { ...indexData }; + return { + props: { + blocks: { + index: indexContent, + body: bodyContent, + }, + frontmatter, + }, + }; +} + +export default function ImplementationsPages({ + blocks, + frontmatter, +}: { + blocks: any; + frontmatter: any; +}) { + return ( + +
+

{frontmatter.title}

+

{frontmatter.type}

+

{frontmatter.Specification}

+ + + +
+
+ ); +} +ImplementationsPages.getLayout = getLayout; diff --git a/pages/draft/2019-09/release-notes.md b/pages/draft/2019-09/release-notes.md index a71d397b5..3285146c4 100644 --- a/pages/draft/2019-09/release-notes.md +++ b/pages/draft/2019-09/release-notes.md @@ -1,68 +1,67 @@ ---- -title: 2019-09 Release Notes -section: docs ---- +### Draft 2019-09 Release Note For the vast majority of schema authors, we hope that these changes are minimally disruptive. -The most likely to be frustrating is that `format` is no longer treated as a validation assertion _by default_ (although it is still possible for an application or user to configure a validator to treat it as one). We decided this was acceptable because many schema authors are already extremely frustrated by its inconsistent behavior. +The most likely to be frustrating is that `format` is no longer treated as a validation assertion *by default* (although it is still possible for an application or user to configure a validator to treat it as one). We decided this was acceptable because many schema authors are already extremely frustrated by its inconsistent behavior. For implementors, there is a lot more to consider, and further guidance on implementation topics will be forthcoming. -* [Incompatible Changes](#incompatible-changes) -* [Semi-incompatible Changes](#semi-incompatible-changes) -* [Annotations, Errors, and Outputs](#annotations-errors-and-outputs) -* [Keyword Changes](#keyword-changes) - * [Core Vocabulary](#core-vocabulary) - * [Applicator Vocabulary](#applicator-vocabulary) - * [Validation Vocabulary](#validation-vocabulary) - * [Format Vocabulary](#format-vocabulary) - * [Content Vocabulary](#content-vocabulary) - * [Meta-Data Vocabulary](#meta-data-vocabulary) - * [Hyper-Schema Vocabulary](#hyper-schema-vocabulary) + +- [Incompatible Changes](https://json-schema.org/draft/2019-09/release-notes#incompatible-changes) +- [Semi-incompatible Changes](https://json-schema.org/draft/2019-09/release-notes#semi-incompatible-changes) +- [Annotations, Errors, and Outputs](https://json-schema.org/draft/2019-09/release-notes#annotations-errors-and-outputs) +- [Keyword Changes](https://json-schema.org/draft/2019-09/release-notes#keyword-changes) + - [Core Vocabulary](https://json-schema.org/draft/2019-09/release-notes#core-vocabulary) + - [Applicator Vocabulary](https://json-schema.org/draft/2019-09/release-notes#applicator-vocabulary) + - [Validation Vocabulary](https://json-schema.org/draft/2019-09/release-notes#validation-vocabulary) + - [Format Vocabulary](https://json-schema.org/draft/2019-09/release-notes#format-vocabulary) + - [Content Vocabulary](https://json-schema.org/draft/2019-09/release-notes#content-vocabulary) + - [Meta-Data Vocabulary](https://json-schema.org/draft/2019-09/release-notes#meta-data-vocabulary) + - [Hyper-Schema Vocabulary](https://json-schema.org/draft/2019-09/release-notes#hyper-schema-vocabulary) For a basic list of changes to each document, see their change logs: -* [Core](../../draft/2019-09/json-schema-core.html#rfc.appendix.C) -* [Validation](../../draft/2019-09/json-schema-validation.html#rfc.appendix.C) -* [Hyper-Schema](../../draft/2019-09/json-schema-hypermedia.html#rfc.appendix.B) -### Incompatible Changes +- [Core](https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.appendix.C) +- [Validation](https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.appendix.C) +- [Hyper-Schema](https://json-schema.org/draft/2019-09/json-schema-hypermedia.html#rfc.appendix.B) + +#### Incompatible Changes -* By default, `format` is no longer an assertion. This has been done because the inconsistent implementation of `format` as an assertion has been an endless source of surprising problems for schema authors. The default behavior will now be predictable, if not ideal. There are several ways to turn on assertion functionality, as explained below. However, we recommend doing semantic validation in the application layer. -* Plain name fragments are no longer defined with `$id`, but instead with the new keyword `$anchor` (which has a different syntax). -* `$id` cannot contain a fragment anymore (except possibly an empty fragment, although that is discouraged). -* In cases where multiple URIs could be used for the same schema, some are now discouraged. These are believed to have rarely been used, as the behavior involved was fairly confusing and not well explained until the updated version of draft-07 (draft-handrews-json-schema-01). If this doesn't mean much to you, you are probably safe. +- By default, `format` is no longer an assertion. This has been done because the inconsistent implementation of `format` as an assertion has been an endless source of surprising problems for schema authors. The default behavior will now be predictable, if not ideal. There are several ways to turn on assertion functionality, as explained below. However, we recommend doing semantic validation in the application layer. +- Plain name fragments are no longer defined with `$id`, but instead with the new keyword `$anchor` (which has a different syntax). +- `$id` cannot contain a fragment anymore (except possibly an empty fragment, although that is discouraged). +- In cases where multiple URIs could be used for the same schema, some are now discouraged. These are believed to have rarely been used, as the behavior involved was fairly confusing and not well explained until the updated version of draft-07 (draft-handrews-json-schema-01). If this doesn't mean much to you, you are probably safe. -### Semi-incompatible Changes +#### Semi-incompatible Changes -The old syntax for these keywords is not an error (and the default meta-schema still validates them), so implementations can therefore offer a compatibility mode. However, migrating to the new keywords is straightforward and should be preferred. +The old syntax for these keywords is not an error (and the default meta-schema still validates them), so implementations can therefore offer a compatibility mode. However, migrating to the new keywords is straightforward and should be preferred. -* `definitions` is now `$defs` -* `dependencies` has been split into `dependentSchemas` and `dependentRequired` +- `definitions` is now `$defs` +- `dependencies` has been split into `dependentSchemas` and `dependentRequired` -### Annotations, Errors, and Outputs +#### Annotations, Errors, and Outputs -[Annotation keywords](../../draft/2019-09/json-schema-core.html#rfc.section.7.7) such as `title`, `readOnly`, and `default` have always been a part of JSON Schema, but without any guidance on how to make use of them. This draft formalizes how implementations can make annotation information available to applications. +[Annotation keywords](https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.7.7) such as `title`, `readOnly`, and `default` have always been a part of JSON Schema, but without any guidance on how to make use of them. This draft formalizes how implementations can make annotation information available to applications. Similarly, there has not previously been guidance on what constitutes useful error reporting when validation fails. -To solve both of these problems, we now recommend that implementations support one or more of standardized [output formats](../../draft/2019-09/json-schema-core.html#rfc.section.10). +To solve both of these problems, we now recommend that implementations support one or more of standardized [output formats](https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.10). -### Keyword Changes +#### Keyword Changes -All keywords have now been organized into [vocabularies](../../draft/2019-09/json-schema-core.html#rfc.section.8.1), with the Core and Validation specifications containing multiple vocabularies. In this process, some keywords have moved from Validation into Core. +All keywords have now been organized into [vocabularies](https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.8.1), with the Core and Validation specifications containing multiple vocabularies. In this process, some keywords have moved from Validation into Core. #### Core Vocabulary [Core Specification, Section 8](../../draft/2019-09/json-schema-core.html#rfc.section.8) -keyword | change | notes ----- | ---- | ---- -[`$anchor`](../../draft/2019-09/json-schema-core.html#rfc.section.8.2.3) | **new** | Replaces the `#plain-name` form of `$id`, with a different syntax and approach -[`$defs` (renamed from `definitions`)](../../draft/2019-09/json-schema-core.html#rfc.section.8.2.5) | **renamed** | Note that the standard meta-schema still reserves `definitions` for backwards compatibility -[`$id`](../../draft/2019-09/json-schema-core.html#rfc.section.8.2.2) | **changed** | Only URI-references without fragments are allowed; see `$anchor` for a replacement for plain-name fragments; all other fragments in `$id` had undefined behavior previously -[`$recursiveAnchor` and `$recursiveRef`](../../draft/2019-09/json-schema-core.html#rfc.section.8.2.4.2) | **new** | Used for extending recursive schemas such as meta-schemas -[`$ref`](../../draft/2019-09/json-schema-core.html#rfc.section.8.2.4) | **changed** | Other keywords are now allowed alongside of it -[`$vocabulary`](../../draft/2019-09/json-schema-core.html#rfc.section.8.1) | **new** | Has effects only in meta-schemas, and is used to control what keywords an implementation must or can support in order to process a schema using that meta-schema +| keyword | change | notes | +| ------------------------------------------------------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [`$anchor`](../../draft/2019-09/json-schema-core.html#rfc.section.8.2.3) | **new** | Replaces the `#plain-name` form of `$id`, with a different syntax and approach | +| [`$defs` (renamed from `definitions`)](../../draft/2019-09/json-schema-core.html#rfc.section.8.2.5) | **renamed** | Note that the standard meta-schema still reserves `definitions` for backwards compatibility | +| [`$id`](../../draft/2019-09/json-schema-core.html#rfc.section.8.2.2) | **changed** | Only URI-references without fragments are allowed; see `$anchor` for a replacement for plain-name fragments; all other fragments in `$id` had undefined behavior previously | +| [`$recursiveAnchor` and `$recursiveRef`](../../draft/2019-09/json-schema-core.html#rfc.section.8.2.4.2) | **new** | Used for extending recursive schemas such as meta-schemas | +| [`$ref`](../../draft/2019-09/json-schema-core.html#rfc.section.8.2.4) | **changed** | Other keywords are now allowed alongside of it | +| [`$vocabulary`](../../draft/2019-09/json-schema-core.html#rfc.section.8.1) | **new** | Has effects only in meta-schemas, and is used to control what keywords an implementation must or can support in order to process a schema using that meta-schema | #### Applicator Vocabulary @@ -70,11 +69,11 @@ keyword | change | notes These keywords were formerly found in the Validation Specification. -keyword | change | notes ----- | ---- | ---- -[`dependentSchemas` (split from `dependencies`)](../../draft/2019-09/json-schema-core.html#rfc.section.9.2.2.4) | **split** | This is the schema form of `dependencies`; note that the standard meta-schema still reserves `dependencies` for backwards compatibility -[`unevaluatedItems`](../../draft/2019-09/json-schema-core.html#rfc.section.9.3.1.3) | **new** | Similar to `additionalItems`, but can "see" into subschemas and across references -[`unevaluatedProperties`](../../draft/2019-09/json-schema-core.html#rfc.section.9.3.2.4) | **new** | Similar to `additionalProperties`, but can "see" into subschemas and across references +| keyword | change | notes | +| --------------------------------------------------------------------------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| [`dependentSchemas` (split from `dependencies`)](../../draft/2019-09/json-schema-core.html#rfc.section.9.2.2.4) | **split** | This is the schema form of `dependencies`; note that the standard meta-schema still reserves `dependencies` for backwards compatibility | +| [`unevaluatedItems`](../../draft/2019-09/json-schema-core.html#rfc.section.9.3.1.3) | **new** | Similar to `additionalItems`, but can "see" into subschemas and across references | +| [`unevaluatedProperties`](../../draft/2019-09/json-schema-core.html#rfc.section.9.3.2.4) | **new** | Similar to `additionalProperties`, but can "see" into subschemas and across references | The other applicator vocabulary keywords are `items`, `additionalItems`, `properties`, `patternProperties`, `additionalProperties`, `anyOf`, `allOf`, `oneOf`, `not`, `if`, `then`, `else`. @@ -82,91 +81,89 @@ The other applicator vocabulary keywords are `items`, `additionalItems`, `proper [Validation Specification, Section 6](../../draft/2019-09/json-schema-validation.html#rfc.section.6) -keyword | change | notes ----- | ---- | ---- -[`dependentRequired` (split from `dependencies`)](../../draft/2019-09/json-schema-validation.html#rfc.section.6.5.4) | **split** | This is the string array form of `dependencies`; note that the standard meta-schema still reserves `dependencies` for backwards compatibility -[`maxContains` and `minContains`](../../draft/2019-09/json-schema-validation.html#rfc.section.6.4.4) | **new** | Assertion for controlling how many times a subschema must be matched within an array - +| keyword | change | notes | +| -------------------------------------------------------------------------------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| [`dependentRequired` (split from `dependencies`)](../../draft/2019-09/json-schema-validation.html#rfc.section.6.5.4) | **split** | This is the string array form of `dependencies`; note that the standard meta-schema still reserves `dependencies` for backwards compatibility | +| [`maxContains` and `minContains`](../../draft/2019-09/json-schema-validation.html#rfc.section.6.4.4) | **new** | Assertion for controlling how many times a subschema must be matched within an array | #### Format Vocabulary [Validation Specification, Section 7](../../draft/2019-09/json-schema-validation.html#rfc.section.7) -The `format` keywords has always been problematic due to its optional nature. There has never been a way to ensure that the implementation processing your schema supports `format` at all, or if it does, to what degree it validates each type of format. In theory, since each format references a standard specification, if a format is supported, it should behave consistently. In practice, this is not the case. +The `format` keywords has always been problematic due to its optional nature. There has never been a way to ensure that the implementation processing your schema supports `format` at all, or if it does, to what degree it validates each type of format. In theory, since each format references a standard specification, if a format is supported, it should behave consistently. In practice, this is not the case. -There are two ways for an application to validate formats: It can rely on a JSON Schema implementation to validate them (which may or may not have the expected results), or it can note where the `format` keyword has been used and perform its own validation based on that. This second approach is supported by treating `format` as an [annotation keyword](../../draft/2019-09/json-schema-core.html#rfc.section.7.7) and supporting the [basic, detailed, or verbose output formats](../../draft/2019-09/json-schema-core.html#rfc.section.10.4.2). +There are two ways for an application to validate formats: It can rely on a JSON Schema implementation to validate them (which may or may not have the expected results), or it can note where the `format` keyword has been used and perform its own validation based on that. This second approach is supported by treating `format` as an [annotation keyword](../../draft/2019-09/json-schema-core.html#rfc.section.7.7) and supporting the [basic, detailed, or verbose output formats](../../draft/2019-09/json-schema-core.html#rfc.section.10.4.2). -To impose some predictability on this system, the behavior has changed in several ways, as illustrated below. The key difference here is that `format` validation is now predictably off by default, but can be configured to be turned on. In draft-07, it was on (but possibly unimplemented) by default and could be configured to be turned off. +To impose some predictability on this system, the behavior has changed in several ways, as illustrated below. The key difference here is that `format` validation is now predictably off by default, but can be configured to be turned on. In draft-07, it was on (but possibly unimplemented) by default and could be configured to be turned off. -In the following charts, the "supported" column refers to whether and (for `2019-09`) to what degree the implementation claims to support the `format` keyword. The "configuration" column refers to whether some non-default behavior for `format` is configured somehow (in a configuration file, or through a command-line option, or whatever). +In the following charts, the "supported" column refers to whether and (for `2019-09`) to what degree the implementation claims to support the `format` keyword. The "configuration" column refers to whether some non-default behavior for `format` is configured somehow (in a configuration file, or through a command-line option, or whatever). **Summary of draft-07 behavior** -supported | configuration | outcome ------------ | ------------- | ------------- -no | n/a | not validated -yes | _default_ (on)| inconsistently validated -yes | off | not validated +| supported | configuration | outcome | +| --------- | -------------- | ------------------------ | +| no | n/a | not validated | +| yes | _default_ (on) | inconsistently validated | +| yes | off | not validated | -Obviously, each implementation will behave consistently from schema to schema, although some formats may be supported more thoroughly than others despite the wording in the specification. However, complex formats are, in practice, supported to different degrees in each implementation. If they are supported at all. +Obviously, each implementation will behave consistently from schema to schema, although some formats may be supported more thoroughly than others despite the wording in the specification. However, complex formats are, in practice, supported to different degrees in each implementation. If they are supported at all. **Summary of 2019-09 behavior** -The goal with this draft is to make the default behavior predictable, with the inconsistent behavior as an opt-in feature. This is not entirely satisfactory, but we feel that it is a good first step to reduce the number of complaints seen around surprising results. This way, there should at least be fewer surprises. +The goal with this draft is to make the default behavior predictable, with the inconsistent behavior as an opt-in feature. This is not entirely satisfactory, but we feel that it is a good first step to reduce the number of complaints seen around surprising results. This way, there should at least be fewer surprises. -* "best effort" validation is a fairly weak requirement, which matches how things work in practice today. Simple formats are probably fully valid, complex formats may be minimally validated or even not validated at all. +- "best effort" validation is a fairly weak requirement, which matches how things work in practice today. Simple formats are probably fully valid, complex formats may be minimally validated or even not validated at all. -* "full syntax" validation means that you can expect a reasonably thorough syntactic validation, probably corresponding to whatever commonly available libraries can do in the implementation language. For formats such as IP addresses and dates, this is expected to be complete validation. For more complex formats such as email addresses, support will probably still vary significantly. It's unclear how many implementations have ever provided this level of support. +- "full syntax" validation means that you can expect a reasonably thorough syntactic validation, probably corresponding to whatever commonly available libraries can do in the implementation language. For formats such as IP addresses and dates, this is expected to be complete validation. For more complex formats such as email addresses, support will probably still vary significantly. It's unclear how many implementations have ever provided this level of support. -* An outcome of _vocabulary error_ means that the implementation will refuse to process the schema as it cannot satisfy the vocabulary requirement. +- An outcome of _vocabulary error_ means that the implementation will refuse to process the schema as it cannot satisfy the vocabulary requirement. -supported | configuration | vocabulary | outcome ------------ | -------------- | ------------- | ------------- -no | n/a | false | not validated -no | n/a | true | _vocabulary error_ -best effort | _default_ (off)| false | not validated -best effort | _default_ (off)| true | _vocabulary error_ -best effort | on | false | best effort validation -best effort | on | true | _vocabulary error_ -full syntax | _default_ (off)| false | not validated -full syntax | _default_ (off)| true | full syntax validation -full syntax | on | false | full syntax validation -full syntax | on | true | full syntax validation +| supported | configuration | vocabulary | outcome | +| ----------- | --------------- | ---------- | ---------------------- | +| no | n/a | false | not validated | +| no | n/a | true | _vocabulary error_ | +| best effort | _default_ (off) | false | not validated | +| best effort | _default_ (off) | true | _vocabulary error_ | +| best effort | on | false | best effort validation | +| best effort | on | true | _vocabulary error_ | +| full syntax | _default_ (off) | false | not validated | +| full syntax | _default_ (off) | true | full syntax validation | +| full syntax | on | false | full syntax validation | +| full syntax | on | true | full syntax validation | -Note that, given that almost no draft-07 or earlier implementations have offered strict and complete validation of every single format, it seems unlikely that any implementations will support option 3 option in practice. +Note that, given that almost no draft-07 or earlier implementations have offered strict and complete validation of every single format, it seems unlikely that any implementations will support option 3 option in practice. Additionally, two new formats were added, and a specification reference was updated: -format | change | notes ----- | ---- | ---- -[`"duration"`](../../draft/2019-09/json-schema-validation.html#rfc.section.7.3.1) | **added** | The duration format is from the ISO 8601 ABNF as given in Appendix A of RFC 3339 -[`"hostname"` and `"idn-hostname"`](../../draft/2019-09/json-schema-validation.html#rfc.section.7.3.3) | **updated** | Use RFC 1123 instead of RFC 1034; this allows for a leading digit -[`"uuid"`](../../draft/2019-09/json-schema-validation.html#rfc.section.7.3.5) | **added** | A string instance is valid against this attribute if it is a valid string representation of a UUID, according to RFC4122 - +| format | change | notes | +| ------------------------------------------------------------------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------ | +| [`"duration"`](../../draft/2019-09/json-schema-validation.html#rfc.section.7.3.1) | **added** | The duration format is from the ISO 8601 ABNF as given in Appendix A of RFC 3339 | +| [`"hostname"` and `"idn-hostname"`](../../draft/2019-09/json-schema-validation.html#rfc.section.7.3.3) | **updated** | Use RFC 1123 instead of RFC 1034; this allows for a leading digit | +| [`"uuid"`](../../draft/2019-09/json-schema-validation.html#rfc.section.7.3.5) | **added** | A string instance is valid against this attribute if it is a valid string representation of a UUID, according to RFC4122 | #### Content Vocabulary [Validation Specification, Section 8](../../draft/2019-09/json-schema-validation.html#rfc.section.8) -These keywords are now specified purely as annotations, and never assertions. Some guidance is provided around how an implementation can optionally offer further automatic processing of this information outside of the validation process. +These keywords are now specified purely as annotations, and never assertions. Some guidance is provided around how an implementation can optionally offer further automatic processing of this information outside of the validation process. -keyword | change | notes ----- | ---- | ---- -[`contentEncoding`](../../draft/2019-09/json-schema-validation.html#rfc.section.8.3) | **updated** | Encodings from RFC 4648 are now allowed, and take precedence over RFC 2045 when there is a difference -[`contentSchema`](../../draft/2019-09/json-schema-validation.html#rfc.section.8.5) | **added** | Schema for use with the decoded content string; note that it is _not_ automatically applied as not all content media types can be understood in advance +| keyword | change | notes | +| ------------------------------------------------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [`contentEncoding`](../../draft/2019-09/json-schema-validation.html#rfc.section.8.3) | **updated** | Encodings from RFC 4648 are now allowed, and take precedence over RFC 2045 when there is a difference | +| [`contentSchema`](../../draft/2019-09/json-schema-validation.html#rfc.section.8.5) | **added** | Schema for use with the decoded content string; note that it is _not_ automatically applied as not all content media types can be understood in advance | #### Meta-Data Vocabulary [Validation Specification, Section 9](../../draft/2019-09/json-schema-validation.html#rfc.section.9) -keyword | change | notes ----- | ---- | ---- -[`deprecated`](../../draft/2019-09/json-schema-validation.html#rfc.section.9.3) | **added** | Used to indicate that a field is deprecated in some application-specific manner +| keyword | change | notes | +| ------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------- | +| [`deprecated`](../../draft/2019-09/json-schema-validation.html#rfc.section.9.3) | **added** | Used to indicate that a field is deprecated in some application-specific manner | #### Hyper-Schema Vocabulary [Hyper-Schema Specification, Sections 5 and 6](../../draft/2019-09/json-schema-hypermedia.html#rfc.section.5) -keyword | change | notes ----- | ---- | ---- -[`rel`](../../draft/2019-09/json-schema-hypermedia.html#rfc.section.6.2.1) | **changed** | Can now be an array of values instead of just a string +| keyword | change | notes | +| -------------------------------------------------------------------------- | ----------- | ------------------------------------------------------ | +| [`rel`](../../draft/2019-09/json-schema-hypermedia.html#rfc.section.6.2.1) | **changed** | Can now be an array of values instead of just a string | diff --git a/pages/draft/2020-12/[slug].page.tsx b/pages/draft/2020-12/[slug].page.tsx deleted file mode 100644 index 52734da09..000000000 --- a/pages/draft/2020-12/[slug].page.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import React from 'react'; -import Head from 'next/head'; -import { getLayout } from '~/components/Sidebar'; -import StyledMarkdown from '~/components/StyledMarkdown'; -import getStaticMarkdownPaths from '~/lib/getStaticMarkdownPaths'; -import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps'; -import { Headline1 } from '~/components/Headlines'; -import { SectionContext } from '~/context'; -import { DocsHelp } from '~/components/DocsHelp'; - -export async function getStaticPaths() { - return getStaticMarkdownPaths('pages/draft/2020-12'); -} -export async function getStaticProps(args: any) { - return getStaticMarkdownProps(args, 'pages/draft/2020-12'); -} - -export default function StaticMarkdownPage({ - frontmatter, - content, -}: { - frontmatter: any; - content: any; -}) { - const markdownFile = '_index'; - const newTitle = 'JSON Schema - ' + frontmatter.title; - - return ( - - - {newTitle} - - {frontmatter.title} - - - - ); -} -StaticMarkdownPage.getLayout = getLayout; diff --git a/pages/draft/2020-12/index.md b/pages/draft/2020-12/index.md new file mode 100644 index 000000000..228828621 --- /dev/null +++ b/pages/draft/2020-12/index.md @@ -0,0 +1,41 @@ +--- +title: Draft 2020-12 +type: docs +specification: "https://json-schema.org/draft/2020-12/json-schema-core.html" +--- + +### Introduction + +[Placeholder text] + +### Access all data connected to Draft 2020-12 + +- Specifications + - Core: [draft-bhutton-json-schema-01](https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-01.html) ([changes](https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-01.html#appendix-G)) + - Validation: [draft-bhutton-json-schema-validation-01](https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-01.html) ([changes](https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-01.html#appendix-C)) + - Relative JSON Pointer: [draft-bhutton-relative-json-pointer-00](https://tools.ietf.org/html/draft-bhutton-relative-json-pointer-00) ([changes](https://tools.ietf.org/html/draft-bhutton-relative-json-pointer-00#appendix-A)) + - Published: 16-June-2022 +- General use meta-schemas + - [JSON Schema meta-schema](https://json-schema.org/draft/2020-12/schema) + - [JSON Hyper-Schema meta-schema](https://json-schema.org/draft/2020-12/hyper-schema) (2019-09 Hyper-Schema with 2020-12 Validation) + - [JSON Hyper-Schema Link Description Object meta-schema](https://json-schema.org/draft/2020-12/links) +- Individual vocabulary meta-schemas + - [Core Vocabulary meta-schema](https://json-schema.org/draft/2020-12/meta/core) + - [Applicator Vocabulary meta-schema](https://json-schema.org/draft/2020-12/meta/applicator) + - [Validation Vocabulary meta-schema](https://json-schema.org/draft/2020-12/meta/validation) + - [Unevaluated Vocabulary meta-schema](https://json-schema.org/draft/2020-12/meta/unevaluated) + - [Format Annotation Vocabulary meta-schema](https://json-schema.org/draft/2020-12/meta/format-annotation) + - [Format Assertion Vocabulary meta-schema](https://json-schema.org/draft/2020-12/meta/format-assertion) + - [Content Vocabulary meta-schema](https://json-schema.org/draft/2020-12/meta/content) + - [Meta-Data Vocabulary meta-schema](https://json-schema.org/draft/2020-12/meta/meta-data) +- Output schemas + - [JSON Schema recommended output schema](https://json-schema.org/draft/2020-12/output/schema) +- Output examples + - [JSON Schema verbose output example](https://json-schema.org/draft/2020-12/output/verbose-example) + +#### Obsolete Draft 2020-12 Documents + +_These were updated without changing functionality or meta-schemas due to a few errors and unclear sections._ + +- Core: [draft-bhutton-json-schema-00](https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-00.html) ([changes](https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-00.html#rfc.appendix.G)) +- Validation: [draft-bhutton-json-schema-validation-00](https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00.html) ([changes](https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00.html#rfc.appendix.C)) diff --git a/pages/draft/2020-12/index.page.tsx b/pages/draft/2020-12/index.page.tsx new file mode 100644 index 000000000..a26e144dd --- /dev/null +++ b/pages/draft/2020-12/index.page.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import { getLayout } from '~/components/SiteLayout'; +import fs from 'fs'; +import matter from 'gray-matter'; +import StyledMarkdown from '~/components/StyledMarkdown'; +import { SectionContext } from '~/context'; + +export async function getStaticProps() { + const index = fs.readFileSync('pages/draft/2020-12/index.md', 'utf-8'); + const main = fs.readFileSync('pages/draft/2020-12/release-notes.md', 'utf-8'); + const { content: indexContent, data: indexData } = matter(index); + const { content: bodyContent } = matter(main); + + const frontmatter = { ...indexData }; + return { + props: { + blocks: { + index: indexContent, + body: bodyContent, + }, + frontmatter, + }, + }; +} + +export default function ImplementationsPages({ + blocks, + frontmatter, +}: { + blocks: any; + frontmatter: any; +}) { + return ( + +
+

{frontmatter.title}

+

{frontmatter.type}

+

{frontmatter.Specification}

+ + + +
+
+ ); +} +ImplementationsPages.getLayout = getLayout; diff --git a/pages/draft/2020-12/release-notes.md b/pages/draft/2020-12/release-notes.md index cd04ba966..c6269a20b 100644 --- a/pages/draft/2020-12/release-notes.md +++ b/pages/draft/2020-12/release-notes.md @@ -1,7 +1,5 @@ ---- -title: 2020-12 Release Notes -section: docs ---- +### Draft 2020-12 Release Notes + The previous draft (2019-09) introduced a lot of new concepts including `$recursiveRef`/`$recursiveAnchor`, `unevaluatedProperties`/`unevaluatedItems`, vocabularies, and more. Since then, these new features have seen multiple @@ -12,7 +10,8 @@ using these new features in the wild. This document attempts to put information most useful to schema authors toward the top and information for implementation authors toward the bottom. -## Changes to items and additionalItems +#### Changes to items and additionalItems + The keywords used for defining arrays and tuples have been redesigned to help lower the learning curve for JSON Schema. Since the `items` keyword was used for both types, we would often see people mistakenly defining a tuple when they @@ -31,7 +30,8 @@ items that come before the normal items (`prefixItems`). Here are some examples to illustrate the changes. -### Open tuple +##### Open tuple + @@ -63,7 +63,8 @@ Here are some examples to illustrate the changes.
-### Closed tuple +##### Closed tuple + @@ -97,7 +98,8 @@ Here are some examples to illustrate the changes.
-### Tuple with constrained additional items +##### Tuple with constrained additional items + @@ -131,7 +133,8 @@ Here are some examples to illustrate the changes.
-## $dynamicRef and $dynamicAnchor +#### $dynamicRef and $dynamicAnchor + The `$recursiveRef` and `$recursiveAnchor` keywords were replaced by the more powerful `$dynamicRef` and `$dynamicAnchor` keywords. `$recursiveRef` and `$recursiveAnchor` were introduced in the previous draft to solve the problem of @@ -187,6 +190,7 @@ Here's how you would covert a schema using `$recursiveRef` to use `$dynamicRef`. "unevaluatedProperties": false } ``` + @@ -214,14 +218,14 @@ Here's how you would covert a schema using `$recursiveRef` to use `$dynamicRef`. "unevaluatedProperties": false } ``` + +#### contains and unevaluatedItems - -## contains and unevaluatedItems In the previous draft, it wasn't specified how or if the `contains` keyword affects the `unevaluatedItems` keyword. This draft specifies that any item in an array that passes validation of the `contains` schema is considered "evaluated". @@ -317,19 +321,22 @@ Given this schema, the instance `["a", "b", "ccc"]` will fail because `"ccc"` is considered unevaluated and fails the `unevaluatedItems` keyword like it did in previous drafts. -## Regular Expressions +#### Regular Expressions + Regular expressions are now expected (but not strictly required) to support unicode characters. Previously, this was unspecified and implementations may or may not support this unicode in regular expressions. -## Media Type Changes +#### Media Type Changes + JSON Schema defines two media types, `application/schema+json` and `application/schema-instance+json`. This draft drops support for the `schema` media type parameter. It's caused a lot of confusion and disagreement. Since we haven't seen any evidence of anyone actually using it, it was decided to remove it for now. -## Embedded Schemas and Bundling +#### Embedded Schemas and Bundling + In Draft 2019-09, the meaning of `$id` in a sub-schema changed from indicating a base URI change within the current schema to indicating an embedded schema independent of the parent schema. A schema that contains one or more embedded @@ -400,7 +407,7 @@ external references that we want to bundle. "$defs": { "phone": { "type": "string", - "pattern": "^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$" + "pattern": "^[+]?[(]?[0-9]{3}[)]?[-s.]?[0-9]{3}[-s.]?[0-9]{4,6}$" }, "usaPostalCode": { "type": "string", @@ -474,24 +481,26 @@ Here are a few things you might notice from this example. 1. No `$ref`s were modified. Even local references are unchanged. 2. `https://example.com/schema/common#/` -`$defs/unsignedInt` got pulled in with the -common schema even though it isn't used. It's allowed to trim out the extra -definitions, but not necessary. + `$defs/unsignedInt` got pulled in with the + common schema even though it isn't used. It's allowed to trim out the extra + definitions, but not necessary. 3. `https://example.com/schema/address` doesn't declare a `$schema`. Because it -uses the same `$schema` as `https://example.com/schema/customer`, it can skip -that declaration and use the `$schema` from the schema it's embedded in. + uses the same `$schema` as `https://example.com/schema/customer`, it can skip + that declaration and use the `$schema` from the schema it's embedded in. 4. `https://example.com/schema/common` uses a different `$schema` than the -document it's embedded in. That's allowed. + document it's embedded in. That's allowed. 5. Definitions from `https://example.com/schema/common` are used in both of the -other schemas and only needs to be included once. It isn't necessary for -bundlers to embed a schema inside another embedded schema. + other schemas and only needs to be included once. It isn't necessary for + bundlers to embed a schema inside another embedded schema. + +#### Annotations -## Annotations Implementations that collect annotations should now include annotations for unknown keywords in the "verbose" output format. The annotation value for an unknown keyword is the keyword's value. -## Vocabulary Changes +#### Vocabulary Changes + The `unevaluatedProperties` and `unevaluatedItems` keywords have been moved from the applicator vocabulary to their own designated vocabulary which is required in the default meta-schema. In Draft 2019-09, these keywords were expected to diff --git a/pages/format4/body.md b/pages/format4/body.md new file mode 100644 index 000000000..1006bd1a4 --- /dev/null +++ b/pages/format4/body.md @@ -0,0 +1,2 @@ + +### Hello from body.md \ No newline at end of file diff --git a/pages/format4/index.md b/pages/format4/index.md new file mode 100644 index 000000000..adc1a34ad --- /dev/null +++ b/pages/format4/index.md @@ -0,0 +1,6 @@ +--- +title: Title +type: Type +--- + +### Hello from index.md diff --git a/pages/format4/index.page.tsx b/pages/format4/index.page.tsx new file mode 100644 index 000000000..fe800f5e1 --- /dev/null +++ b/pages/format4/index.page.tsx @@ -0,0 +1,45 @@ +import React from 'react'; +import { getLayout } from '~/components/SiteLayout'; +import fs from 'fs'; +import matter from 'gray-matter'; +import StyledMarkdown from '~/components/StyledMarkdown'; +import { SectionContext } from '~/context'; + +export async function getStaticProps() { + const index = fs.readFileSync('pages/format4/index.md', 'utf-8'); + const main = fs.readFileSync('pages/format4/body.md', 'utf-8'); + const { content: indexContent, data: indexData } = matter(index); + const { content: bodyContent } = matter(main); + + const frontmatter = { ...indexData }; + return { + props: { + blocks: { + index: indexContent, + body: bodyContent, + }, + frontmatter, + }, + }; +} + +export default function ImplementationsPages({ + blocks, + frontmatter, +}: { + blocks: any; + frontmatter: any; +}) { + return ( + +
+

{frontmatter.title}

+

{frontmatter.type}

+ + + +
+
+ ); +} +ImplementationsPages.getLayout = getLayout; From 4292510b75dc2a96d20b2c564d3f3a2f84f4219b Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe Date: Thu, 18 Jul 2024 14:14:05 +0100 Subject: [PATCH 02/35] Updating draft sections --- components/Sidebar.tsx | 10 +- pages/draft-05/[slug].page.tsx | 38 ---- pages/draft-05/index.md | 26 +++ pages/draft-05/index.page.tsx | 46 +++++ .../draft-05/{readme.md => release-notes.md} | 9 +- pages/draft-06/[slug].page.tsx | 39 ---- pages/draft-06/index.md | 25 +++ pages/draft-06/index.page.tsx | 46 +++++ pages/draft-06/json-schema-release-notes.md | 169 +++++++++--------- pages/draft-07/[slug].page.tsx | 39 ---- pages/draft-07/index.md | 39 ++++ pages/draft-07/index.page.tsx | 46 +++++ pages/draft-07/json-schema-release-notes.md | 40 +---- pages/draft/2019-09/[slug].page.tsx | 39 ---- pages/draft/2019-09/index.md | 2 +- pages/draft/2020-12/index.md | 9 + pages/migration/index.md | 14 ++ pages/migration/index.page.tsx | 46 +++++ 18 files changed, 393 insertions(+), 289 deletions(-) delete mode 100644 pages/draft-05/[slug].page.tsx create mode 100644 pages/draft-05/index.md create mode 100644 pages/draft-05/index.page.tsx rename pages/draft-05/{readme.md => release-notes.md} (68%) delete mode 100644 pages/draft-06/[slug].page.tsx create mode 100644 pages/draft-06/index.md create mode 100644 pages/draft-06/index.page.tsx delete mode 100644 pages/draft-07/[slug].page.tsx create mode 100644 pages/draft-07/index.md create mode 100644 pages/draft-07/index.page.tsx delete mode 100644 pages/draft/2019-09/[slug].page.tsx create mode 100644 pages/migration/index.md create mode 100644 pages/migration/index.page.tsx diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index c75aefe43..57b01d5b6 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -662,17 +662,17 @@ export const DocsNav = ({ setOpen={setOpen} /> @@ -685,12 +685,12 @@ export const DocsNav = ({ /> diff --git a/pages/draft-05/[slug].page.tsx b/pages/draft-05/[slug].page.tsx deleted file mode 100644 index 798581221..000000000 --- a/pages/draft-05/[slug].page.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import React from 'react'; -import Head from 'next/head'; -import StyledMarkdown from '~/components/StyledMarkdown'; -import { getLayout } from '~/components/Sidebar'; -import getStaticMarkdownPaths from '~/lib/getStaticMarkdownPaths'; -import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps'; -import { Headline1 } from '~/components/Headlines'; -import { SectionContext } from '~/context'; -import { DocsHelp } from '~/components/DocsHelp'; - -export async function getStaticPaths() { - return getStaticMarkdownPaths('pages/draft-05'); -} -export async function getStaticProps(args: any) { - return getStaticMarkdownProps(args, 'pages/draft-05'); -} - -export default function StaticMarkdownPage({ - frontmatter, - content, -}: { - frontmatter: any; - content: any; -}) { - const markdownFile = '_index'; - const newTitle = 'JSON Schema - ' + frontmatter.title; - return ( - - - {newTitle} - - {frontmatter.title} - - - - ); -} -StaticMarkdownPage.getLayout = getLayout; diff --git a/pages/draft-05/index.md b/pages/draft-05/index.md new file mode 100644 index 000000000..7942e6340 --- /dev/null +++ b/pages/draft-05/index.md @@ -0,0 +1,26 @@ +--- +title: Draft-05 +type: docs +Specification: https://json-schema.org/draft/2020-12/json-schema-core.html +Authors: + - Austin Wright + - Henry Andrews + - Ben Hutton + - Greg Dennis +Published: 21-April-2017 +Metaschema: https://json-schema.org/draft/2020-12/schema +Implementations: https://bowtie.report/#/dialects/draft2020-12 +Status: Stable +--- + +### Introduction + +[Placeholder text] + +### Access all data connected to draft 05 + +- Core: [draft-wright-json-schema-00](https://json-schema.org/draft-05/draft-wright-json-schema-00.pdf) ([changes](https://json-schema.org/draft-05/draft-wright-json-schema-00.pdf#appendix-B)) +- Validation: [draft-wright-json-schema-validation-00](https://json-schema.org/draft-05/draft-wright-json-schema-validation-00.pdf) ([changes](https://json-schema.org/draft-05/draft-wright-json-schema-validation-00.pdf#appendix-B)) +- Hyper-Schema: [draft-wright-json-schema-hyperschema-00](https://json-schema.org/draft-05/draft-wright-json-schema-hyperschema-00.pdf) ([changes](https://json-schema.org/draft-05/draft-wright-json-schema-hyperschema-00.pdf#appendix-B)) +- Draft 5 was primarily a cleanup of Draft 4 and continued to use the Draft 4 meta-schemas. +- Published: 13-October-2016 diff --git a/pages/draft-05/index.page.tsx b/pages/draft-05/index.page.tsx new file mode 100644 index 000000000..c37729cc4 --- /dev/null +++ b/pages/draft-05/index.page.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import { getLayout } from '~/components/SiteLayout'; +import fs from 'fs'; +import matter from 'gray-matter'; +import StyledMarkdown from '~/components/StyledMarkdown'; +import { SectionContext } from '~/context'; + +export async function getStaticProps() { + const index = fs.readFileSync('pages/draft-05/index.md', 'utf-8'); + const main = fs.readFileSync('pages/draft-05/release-notes.md', 'utf-8'); + const { content: indexContent, data: indexData } = matter(index); + const { content: bodyContent } = matter(main); + + const frontmatter = { ...indexData }; + return { + props: { + blocks: { + index: indexContent, + body: bodyContent, + }, + frontmatter, + }, + }; +} + +export default function ImplementationsPages({ + blocks, + frontmatter, +}: { + blocks: any; + frontmatter: any; +}) { + return ( + +
+

{frontmatter.title}

+

{frontmatter.type}

+

{frontmatter.Specification}

+ + + +
+
+ ); +} +ImplementationsPages.getLayout = getLayout; diff --git a/pages/draft-05/readme.md b/pages/draft-05/release-notes.md similarity index 68% rename from pages/draft-05/readme.md rename to pages/draft-05/release-notes.md index d7289cc4c..cd6a96658 100644 --- a/pages/draft-05/readme.md +++ b/pages/draft-05/release-notes.md @@ -1,10 +1,7 @@ ---- -title: Explanation for lack of draft-05 meta-schemas -section: docs ---- +### Explanation for lack of draft-05 meta-schemas -“Draft-05” in the sequential meta-schema numbering would have referred to the draft-wright-jsonschema*-00 specifications. +“Draft-05” in the sequential meta-schema numbering would have referred to the draft-wright-jsonschema\*-00 specifications. These specifications were intended as modernized and tidied versions of the specifications referenced by the “Draft-04” meta-schemas, so those draft-04 meta-schemas should continue to be used. -“Draft-06” meta-schemas will be published for the next set of specifications. \ No newline at end of file +“Draft-06” meta-schemas will be published for the next set of specifications. diff --git a/pages/draft-06/[slug].page.tsx b/pages/draft-06/[slug].page.tsx deleted file mode 100644 index fc447db63..000000000 --- a/pages/draft-06/[slug].page.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import React from 'react'; -import Head from 'next/head'; -import { getLayout } from '~/components/Sidebar'; -import StyledMarkdown from '~/components/StyledMarkdown'; -import getStaticMarkdownPaths from '~/lib/getStaticMarkdownPaths'; -import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps'; -import { Headline1 } from '~/components/Headlines'; -import { SectionContext } from '~/context'; -import { DocsHelp } from '~/components/DocsHelp'; - -export async function getStaticPaths() { - return getStaticMarkdownPaths('pages/draft-06'); -} -export async function getStaticProps(args: any) { - return getStaticMarkdownProps(args, 'pages/draft-06'); -} - -export default function StaticMarkdownPage({ - frontmatter, - content, -}: { - frontmatter: any; - content: any; -}) { - const markdownFile = '_index'; - const newTitle = 'JSON Schema - ' + frontmatter.title; - - return ( - - - {newTitle} - - {frontmatter.title} - - - - ); -} -StaticMarkdownPage.getLayout = getLayout; diff --git a/pages/draft-06/index.md b/pages/draft-06/index.md new file mode 100644 index 000000000..7e2a768ed --- /dev/null +++ b/pages/draft-06/index.md @@ -0,0 +1,25 @@ +--- +title: Draft-06 +type: docs +Specification: https://json-schema.org/draft/2020-12/json-schema-core.html +Authors: + - Austin Wright + - Henry Andrews + - Ben Hutton + - Greg Dennis +Published: 21-April-2017 +Metaschema: https://json-schema.org/draft/2020-12/schema +Implementations: https://bowtie.report/#/dialects/draft2020-12 +Status: Stable +--- + +### Introduction + +[Placeholder text] + +### Access all data connected to draft 2019-09 + +- Validation: [draft-wright-json-schema-validation-01](https://json-schema.org/draft-06/draft-wright-json-schema-validation-01.html) ([changes](https://json-schema.org/draft-06/draft-wright-json-schema-validation-01.html#rfc.appendix.B)) ([schema migration FAQ](https://json-schema.org/draft-06/json-schema-release-notes)) +- Hyper-Schema: [draft-wright-json-schema-hyperschema-01](https://json-schema.org/draft-06/draft-wright-json-schema-hyperschema-01.html) ([changes](https://json-schema.org/draft-06/draft-wright-json-schema-hyperschema-01.html#rfc.appendix.B)) ([hyper-schema migration FAQ](https://json-schema.org/draft-06/json-hyper-schema-release-notes)) +- [JSON Schema meta-schema](https://json-schema.org/draft-06/schema) +- [JSON Hyper-Schema meta-schema](https://json-schema.org/draft-06/hyper-schema) diff --git a/pages/draft-06/index.page.tsx b/pages/draft-06/index.page.tsx new file mode 100644 index 000000000..03ee27c5b --- /dev/null +++ b/pages/draft-06/index.page.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import { getLayout } from '~/components/SiteLayout'; +import fs from 'fs'; +import matter from 'gray-matter'; +import StyledMarkdown from '~/components/StyledMarkdown'; +import { SectionContext } from '~/context'; + +export async function getStaticProps() { + const index = fs.readFileSync('pages/draft-06/index.md', 'utf-8'); + const main = fs.readFileSync('pages/draft-06/json-schema-release-notes.md', 'utf-8'); + const { content: indexContent, data: indexData } = matter(index); + const { content: bodyContent } = matter(main); + + const frontmatter = { ...indexData }; + return { + props: { + blocks: { + index: indexContent, + body: bodyContent, + }, + frontmatter, + }, + }; +} + +export default function ImplementationsPages({ + blocks, + frontmatter, +}: { + blocks: any; + frontmatter: any; +}) { + return ( + +
+

{frontmatter.title}

+

{frontmatter.type}

+

{frontmatter.Specification}

+ + + +
+
+ ); +} +ImplementationsPages.getLayout = getLayout; diff --git a/pages/draft-06/json-schema-release-notes.md b/pages/draft-06/json-schema-release-notes.md index d7632ed23..6b1699128 100644 --- a/pages/draft-06/json-schema-release-notes.md +++ b/pages/draft-06/json-schema-release-notes.md @@ -1,7 +1,4 @@ ---- -title: Draft-06 Release Notes -section: docs ---- +### Draft-06 release note Release notes for migrating from zyp-04 and fge-00 (draft-04) to wright-01 (draft-06). @@ -10,41 +7,41 @@ Release notes for migrating from zyp-04 and fge-00 (draft-04) to wright-01 (draf Note that draft-07 core and validation are backwards-compatible with draft-06. For more information, see that draft's [migration notes](../../draft-07/json-schema-release-notes). -* [Q: What are the changes between draft-04 and draft-06?](#q:-what-are-the-changes-between-draft-04-and-draft-06) - * [Backwards-incompatible changes](#backwards-incompatible-changes) - * [Additions and backwards-compatible changes](#additions-and-backwards-compatible-changes) - * [Formats: "uri" vs "uri-reference"](#formats:-vs) -* [Q: What happened to draft-05?](#q:-what-happened-to-draft-05) -* [Q: What happened to all the discussions around re-using schemas with "additionalProperties"?](#q:-what-happened-to-all-the-discussions-around-re-using-schemas-with-additionalproperties) - -### Q: What are the changes between draft-04 and draft-06? - -#### Backwards-incompatible changes - -keyword | change | consequence ----- | ---- | ---- -`"id"` | replaced by `"$id"` | no longer easily confused with instance properties named `"id"` -`"$id"` | replaces `"id"` | behavior is identical, `$` prefix matches the other two core keywords -`"$ref"` | only allowed where a schema is expected | it is now possible to describe instance properties named `"$ref"` -`"exclusiveMinimum"` and `"exclusiveMaximum"` | changed from a boolean to a number to be consistent with the principle of keyword independence | wherever one of these would be true before, change the value to the corresponding `"minimum"` or `"maximum"` value and remove the `"minimum"`/`"maximum"` keyword -`"type"` | definition of `"integer"` | in draft-04, `"integer"` is listed as a primitive type and defined as "a JSON number without a fraction or exponent part"; in draft-06, `"integer"` is not considered a primitive type and is only defined in the section for keyword `"type"` as "any number with a zero fractional part"; `1.0` is thus not a valid `"integer"` type in draft-04 and earlier, but is a valid `"integer"` type in draft-06 and later; note that both drafts say that integers SHOULD be encoded in JSON without fractional parts - -#### Additions and backwards-compatible changes - -keyword | change | consequence ----- | ---- | ---- -booleans as schemas | allowable anywhere, not just `"additionalProperties"` and `"additionalItems"` | `true` is equivalent to `{}`, `false` is equivalent to `{"not": {}}`, but the intent is more clear and implementations can optimize these cases more easily -`"propertyNames"` | added | takes a schema which validates the *names* of all properties rather than their values -`"contains"` | added | array keyword that passes validation if its schema validates at least one array item -`"const"` | added | more readible form of a one-element `"enum"` -`"required"` | allows an empty array | an empty array indicates that no properties are required -`"dependencies"` | allows an empty array for property dependencies | an empty array indicates that there are no dependencies for the given property -`"format": "uri-reference"` | added | allows relative URI references per RFC 3986; see the section below about `"uri"` as a format -`"format": "uri-template"` | added | indicates an RFC 6570 conforming URI Template value, as is used in JSON Hyper-Schema for `"href"` -`"format": "json-pointer"` | added | indicates a JSON Pointer value such as `/foo/bar`; do _not_ use this for JSON Pointer URI fragments such as `#/foo/bar`: the proper format for those is `"uri-reference"` -`"examples"` | added | array of examples with no validation effect; the value of `"default"` is usable as an example without repeating it under this keyword - -#### Formats: `"uri"` vs `"uri-reference"` +- [Q: What are the changes between draft-04 and draft-06?](#q:-what-are-the-changes-between-draft-04-and-draft-06) + - [Backwards-incompatible changes](#backwards-incompatible-changes) + - [Additions and backwards-compatible changes](#additions-and-backwards-compatible-changes) + - [Formats: "uri" vs "uri-reference"](#formats:-vs) +- [Q: What happened to draft-05?](#q:-what-happened-to-draft-05) +- [Q: What happened to all the discussions around re-using schemas with "additionalProperties"?](#q:-what-happened-to-all-the-discussions-around-re-using-schemas-with-additionalproperties) + +#### Q: What are the changes between draft-04 and draft-06? + +##### Backwards-incompatible changes + +| keyword | change | consequence | +| --------------------------------------------- | ---------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `"id"` | replaced by `"$id"` | no longer easily confused with instance properties named `"id"` | +| `"$id"` | replaces `"id"` | behavior is identical, `$` prefix matches the other two core keywords | +| `"$ref"` | only allowed where a schema is expected | it is now possible to describe instance properties named `"$ref"` | +| `"exclusiveMinimum"` and `"exclusiveMaximum"` | changed from a boolean to a number to be consistent with the principle of keyword independence | wherever one of these would be true before, change the value to the corresponding `"minimum"` or `"maximum"` value and remove the `"minimum"`/`"maximum"` keyword | +| `"type"` | definition of `"integer"` | in draft-04, `"integer"` is listed as a primitive type and defined as "a JSON number without a fraction or exponent part"; in draft-06, `"integer"` is not considered a primitive type and is only defined in the section for keyword `"type"` as "any number with a zero fractional part"; `1.0` is thus not a valid `"integer"` type in draft-04 and earlier, but is a valid `"integer"` type in draft-06 and later; note that both drafts say that integers SHOULD be encoded in JSON without fractional parts | + +##### Additions and backwards-compatible changes + +| keyword | change | consequence | +| --------------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| booleans as schemas | allowable anywhere, not just `"additionalProperties"` and `"additionalItems"` | `true` is equivalent to `{}`, `false` is equivalent to `{"not": {}}`, but the intent is more clear and implementations can optimize these cases more easily | +| `"propertyNames"` | added | takes a schema which validates the _names_ of all properties rather than their values | +| `"contains"` | added | array keyword that passes validation if its schema validates at least one array item | +| `"const"` | added | more readible form of a one-element `"enum"` | +| `"required"` | allows an empty array | an empty array indicates that no properties are required | +| `"dependencies"` | allows an empty array for property dependencies | an empty array indicates that there are no dependencies for the given property | +| `"format": "uri-reference"` | added | allows relative URI references per RFC 3986; see the section below about `"uri"` as a format | +| `"format": "uri-template"` | added | indicates an RFC 6570 conforming URI Template value, as is used in JSON Hyper-Schema for `"href"` | +| `"format": "json-pointer"` | added | indicates a JSON Pointer value such as `/foo/bar`; do _not_ use this for JSON Pointer URI fragments such as `#/foo/bar`: the proper format for those is `"uri-reference"` | +| `"examples"` | added | array of examples with no validation effect; the value of `"default"` is usable as an example without repeating it under this keyword | + +##### Formats: `"uri"` vs `"uri-reference"` While not technically a change, the behavior of the `"uri"` format was not clearly explained and often implemented and used incorrectly (including in the draft-04 meta-schema). @@ -54,80 +51,74 @@ When a relative path, fragment, or any other style of URI Reference (per RFC 398 Implementations offering a translation from draft-04 to draft-06 may want to offer an option to convert `"uri"` formats to `"uri-reference"`, although any such option should be disabled by default for strict conformance. -### Q: What happened to draft-05? +#### Q: What happened to draft-05? -The draft-05 core and validation specifications were intended to be more clear and readable rewrites of draft-04, to give us a strong base for draft-06 changes. Implementors should **not** implement or advertise support for "draft-05". +The draft-05 core and validation specifications were intended to be more clear and readable rewrites of draft-04, to give us a strong base for draft-06 changes. Implementors should **not** implement or advertise support for "draft-05". Implementations that supported "draft-05" by implementing proposals from right after the publication of draft-04 should either remove that support or give it a different name to avoid confusion. -### Q: What happened to all the discussions around re-using schemas with `"additionalProperties"`? +#### Q: What happened to all the discussions around re-using schemas with `"additionalProperties"`? -There are several competing proposals for making the re-use of schemas that set `"additionalProperties"` to something other than `true`. Most people specifically care about the case where it is `false`, but the same behavior occurs with any non-`true` value. +There are several competing proposals for making the re-use of schemas that set `"additionalProperties"` to something other than `true`. Most people specifically care about the case where it is `false`, but the same behavior occurs with any non-`true` value. -[All of the proposals in this area](https://github.com/json-schema-org/json-schema-spec/issues?q=is%3Aissue+is%3Aopen+label%3A%22re-use+%2F+addlProps%22) will be the focus of [draft-08](https://github.com/json-schema-org/json-schema-spec/milestone/6). While we made progress in eliminating some options during draft-07, the remaining divisions are deep enough to warrant making it the primary focus of a draft ([draft-07](https://github.com/json-schema-org/json-schema-spec/milestone/5)'s primary focus is Hyper-Schema). +[All of the proposals in this area](https://github.com/json-schema-org/json-schema-spec/issues?q=is%3Aissue+is%3Aopen+label%3A%22re-use+%2F+addlProps%22) will be the focus of [draft-08](https://github.com/json-schema-org/json-schema-spec/milestone/6). While we made progress in eliminating some options during draft-07, the remaining divisions are deep enough to warrant making it the primary focus of a draft ([draft-07](https://github.com/json-schema-org/json-schema-spec/milestone/5)'s primary focus is Hyper-Schema). The difficulty is that if you attempt to do this: ```json { - "type": "object", - "allOf": [ - { "$ref": "#/definitions/foo" }, - { "$ref": "#/definitions/bar" } - ], - "definitions": { - "foo": { - "properties": { - "foo": { "type": "string" } - }, - "additionalProperties": false - }, - "bar": { - "properties": { - "bar": { "type": "number" } - }, - "additionalProperties": false - } + "type": "object", + "allOf": [{ "$ref": "#/definitions/foo" }, { "$ref": "#/definitions/bar" }], + "definitions": { + "foo": { + "properties": { + "foo": { "type": "string" } + }, + "additionalProperties": false + }, + "bar": { + "properties": { + "bar": { "type": "number" } + }, + "additionalProperties": false } + } } ``` -Validation will always fail for any non-empty object instance. `"additionalProperties"` only knows about immediately adjacent `"properties"` and `"patternProperties"`, in order to ensure that each subschema means the same thing whether it is being used with another subschema or on its own. +Validation will always fail for any non-empty object instance. `"additionalProperties"` only knows about immediately adjacent `"properties"` and `"patternProperties"`, in order to ensure that each subschema means the same thing whether it is being used with another subschema or on its own. -So in this example, if the instance has a "bar" property, it will fail the first subschema because "bar" is not "foo". If it has a "foo" property, it will fail the second subschema because "foo" is not "bar". And any other property will fail both schemas. +So in this example, if the instance has a "bar" property, it will fail the first subschema because "bar" is not "foo". If it has a "foo" property, it will fail the second subschema because "foo" is not "bar". And any other property will fail both schemas. A workaround is available with the new `"propertyNames"` keyword: ```json { - "type": "object", - "allOf": [ - { "$ref": "#/definitions/foo" }, - { "$ref": "#/definitions/bar" } - ], - "propertyNames": { - "anyOf": [ - { "$ref": "#/definitions/fooNames" }, - { "$ref": "#/definitions/barNames" } - ] + "type": "object", + "allOf": [{ "$ref": "#/definitions/foo" }, { "$ref": "#/definitions/bar" }], + "propertyNames": { + "anyOf": [ + { "$ref": "#/definitions/fooNames" }, + { "$ref": "#/definitions/barNames" } + ] + }, + "definitions": { + "foo": { + "properties": { + "foo": { "type": "string" } + } }, - "definitions": { - "foo": { - "properties": { - "foo": { "type": "string" } - } - }, - "fooNames": { "enum": ["foo"] }, - "bar": { - "properties": { - "bar": { "type": "number" } - } - }, - "barNames": { "enum": ["bar"] } - } + "fooNames": { "enum": ["foo"] }, + "bar": { + "properties": { + "bar": { "type": "number" } + } + }, + "barNames": { "enum": ["bar"] } + } } ``` -This will allow an object with either "foo" or "bar" or both, but will fail validation if any other property is present. The `"allOf"` ensures that "foo" and "bar" will each be validated correctly if present, while the `"anyOf"` allows for properties with names in either allowed set, but forbids properties that are not listed in at least one set. +This will allow an object with either "foo" or "bar" or both, but will fail validation if any other property is present. The `"allOf"` ensures that "foo" and "bar" will each be validated correctly if present, while the `"anyOf"` allows for properties with names in either allowed set, but forbids properties that are not listed in at least one set. It does require duplicating the names, and the awkward use of both an `"allOf"` and `"anyOf"`, but it is less repetition than other options, and can be re-used fairly robustly even if the "foo" and "bar" schemas are in separate files managed by a different person or organization. diff --git a/pages/draft-07/[slug].page.tsx b/pages/draft-07/[slug].page.tsx deleted file mode 100644 index be10dfdba..000000000 --- a/pages/draft-07/[slug].page.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import React from 'react'; -import Head from 'next/head'; -import StyledMarkdown from '~/components/StyledMarkdown'; -import { getLayout } from '~/components/Sidebar'; -import getStaticMarkdownPaths from '~/lib/getStaticMarkdownPaths'; -import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps'; -import { Headline1 } from '~/components/Headlines'; -import { SectionContext } from '~/context'; -import { DocsHelp } from '~/components/DocsHelp'; - -export async function getStaticPaths() { - return getStaticMarkdownPaths('pages/draft-07'); -} -export async function getStaticProps(args: any) { - return getStaticMarkdownProps(args, 'pages/draft-07'); -} - -export default function StaticMarkdownPage({ - frontmatter, - content, -}: { - frontmatter: any; - content: any; -}) { - const markdownFile = '_index'; - const newTitle = 'JSON Schema - ' + frontmatter.title; - - return ( - - - {newTitle} - - {frontmatter.title} - - - - ); -} -StaticMarkdownPage.getLayout = getLayout; diff --git a/pages/draft-07/index.md b/pages/draft-07/index.md new file mode 100644 index 000000000..05d762bfc --- /dev/null +++ b/pages/draft-07/index.md @@ -0,0 +1,39 @@ +--- +title: Draft 07 +type: docs +specification: "https://json-schema.org/draft/2020-12/json-schema-core.html" +Authors: + - Austin Wright + - Henry Andrews + - Ben Hutton + - Greg Dennis +Published: 19-March-2018 +Metaschema: https://json-schema.org/draft/2020-12/schema +Implementations: https://bowtie.report/#/dialects/draft2020-12 +Status: Stable +--- + +### Introduction + +[Placeholder text] + +### Access all data connected to draft 07 + +- Core: [draft-handrews-json-schema-01](https://json-schema.org/draft-07/draft-handrews-json-schema-01.html) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-01.html#rfc.appendix.B)) +- Validation: [draft-handrews-json-schema-validation-01](https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01.html) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01.html#rfc.appendix.B)) +- Hyper-Schema: [draft-handrews-json-schema-hyperschema-01](https://json-schema.org/draft-07/draft-handrews-json-schema-hyperschema-01.html) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-hyperschema-01.html#rfc.appendix.B)) +- [JSON Schema meta-schema](https://json-schema.org/draft-07/schema) +- [JSON Hyper-Schema meta-schema](https://json-schema.org/draft-07/hyper-schema) +- [JSON Hyper-Schema Link Description Object meta-schema](https://json-schema.org/draft-07/links) +- [JSON Hyper-Schema recommended output schema](https://json-schema.org/draft-07/hyper-schema-output) +- Relative JSON Pointer: [draft-handrews-relative-json-pointer-01](https://tools.ietf.org/html/draft-handrews-relative-json-pointer-01) ([changes](https://tools.ietf.org/html/draft-handrews-relative-json-pointer-01#appendix-B)) +- Published: 19-March-2018 + +#### Obsolete Draft 7 Documents + +_These were updated without changing functionality or meta-schemas due to a few errors and unclear sections._ + +- Core: [draft-handrews-json-schema-00](https://json-schema.org/draft-07/draft-handrews-json-schema-00.pdf) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-00.pdf#appendix-B)) +- Validation: [draft-handrews-json-schema-validation-00](https://json-schema.org/draft-07/draft-handrews-json-schema-validation-00.pdf) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-validation-00.pdf#appendix-B)) +- Hyper-Schema: [draft-handrews-json-schema-hyperschema-00](https://json-schema.org/draft-07/draft-handrews-json-schema-hyperschema-00.html) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-hyperschema-00.html#rfc.appendix.B)) +- Relative JSON Pointer: [draft-handrews-relative-json-pointer-00](https://tools.ietf.org/html/draft-handrews-relative-json-pointer-00) ([changes](https://tools.ietf.org/html/draft-handrews-relative-json-pointer-00#appendix-B)) diff --git a/pages/draft-07/index.page.tsx b/pages/draft-07/index.page.tsx new file mode 100644 index 000000000..58daf9385 --- /dev/null +++ b/pages/draft-07/index.page.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import { getLayout } from '~/components/SiteLayout'; +import fs from 'fs'; +import matter from 'gray-matter'; +import StyledMarkdown from '~/components/StyledMarkdown'; +import { SectionContext } from '~/context'; + +export async function getStaticProps() { + const index = fs.readFileSync('pages/draft-07/index.md', 'utf-8'); + const main = fs.readFileSync('pages/draft-07/json-schema-release-notes.md', 'utf-8'); + const { content: indexContent, data: indexData } = matter(index); + const { content: bodyContent } = matter(main); + + const frontmatter = { ...indexData }; + return { + props: { + blocks: { + index: indexContent, + body: bodyContent, + }, + frontmatter, + }, + }; +} + +export default function ImplementationsPages({ + blocks, + frontmatter, +}: { + blocks: any; + frontmatter: any; +}) { + return ( + +
+

{frontmatter.title}

+

{frontmatter.type}

+

{frontmatter.Specification}

+ + + +
+
+ ); +} +ImplementationsPages.getLayout = getLayout; diff --git a/pages/draft-07/json-schema-release-notes.md b/pages/draft-07/json-schema-release-notes.md index e13e7f0f7..6c1f78eee 100644 --- a/pages/draft-07/json-schema-release-notes.md +++ b/pages/draft-07/json-schema-release-notes.md @@ -1,29 +1,3 @@ ---- -title: Draft-07 Release Notes -section: docs ---- - -### Access all data connected to Draft-07 - -- Core: [draft-handrews-json-schema-01](https://json-schema.org/draft-07/draft-handrews-json-schema-01.html) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-01.html#rfc.appendix.B)) -- Validation: [draft-handrews-json-schema-validation-01](https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01.html) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01.html#rfc.appendix.B)) -- Hyper-Schema: [draft-handrews-json-schema-hyperschema-01](https://json-schema.org/draft-07/draft-handrews-json-schema-hyperschema-01.html) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-hyperschema-01.html#rfc.appendix.B)) -- [JSON Schema meta-schema](https://json-schema.org/draft-07/schema) -- [JSON Hyper-Schema meta-schema](https://json-schema.org/draft-07/hyper-schema) -- [JSON Hyper-Schema Link Description Object meta-schema](https://json-schema.org/draft-07/links) -- [JSON Hyper-Schema recommended output schema](https://json-schema.org/draft-07/hyper-schema-output) -- Relative JSON Pointer: [draft-handrews-relative-json-pointer-01](https://tools.ietf.org/html/draft-handrews-relative-json-pointer-01) ([changes](https://tools.ietf.org/html/draft-handrews-relative-json-pointer-01#appendix-B)) -- Published: 19-March-2018 - -#### Obsolete Draft 7 Documents - -_These were updated without changing functionality or meta-schemas due to a few errors and unclear sections._ - -- Core: [draft-handrews-json-schema-00](https://json-schema.org/draft-07/draft-handrews-json-schema-00.pdf) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-00.pdf#appendix-B)) -- Validation: [draft-handrews-json-schema-validation-00](https://json-schema.org/draft-07/draft-handrews-json-schema-validation-00.pdf) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-validation-00.pdf#appendix-B)) -- Hyper-Schema: [draft-handrews-json-schema-hyperschema-00](https://json-schema.org/draft-07/draft-handrews-json-schema-hyperschema-00.html) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-hyperschema-00.html#rfc.appendix.B)) -- Relative JSON Pointer: [draft-handrews-relative-json-pointer-00](https://tools.ietf.org/html/draft-handrews-relative-json-pointer-00) ([changes](https://tools.ietf.org/html/draft-handrews-relative-json-pointer-00#appendix-B)) - ### Draft-07 Release Note For the Core and Validation specifications, draft-07 is a relatively @@ -43,7 +17,7 @@ more clearly than before. - [Linking Instances and Schemas](#linking-instances-and-schemas) - [Instance Media Type](#instance-media-type) -### Keywords +#### Keywords - No keywords changed behavior - No keywords were removed @@ -60,7 +34,7 @@ more clearly than before. Note that the `"content*"` keywords do not _require_ validation. -### Formats +#### Formats Numerous formats were added, clarified, or restored from older drafts. @@ -82,7 +56,7 @@ consideration. If added as extension formats, they SHOULD be implemented in a way that is compatible with their use in the RFC to ensure future compatibility. -### Classification of Keywords +#### Classification of Keywords While it does not have a direct impact on the validation process, this set of drafts classifies keywords by their behavior. The names of these @@ -96,7 +70,7 @@ to know: Note that `definitions` does not fit any of these categories, nor do the dollar-prefixed Core keywords. -### Collecting Annotation Values +#### Collecting Annotation Values [Annotation keywords](../../draft-07/json-schema-validation.html#rfc.section.10) (formerly called [metadata keywords](../../draft-06/json-schema-validation.html#rfc.section.7) @@ -111,14 +85,14 @@ approprite keywords: - `readOnly` and `writeOnly` should be logically ORed - `examples` should be flattened into a single collected array -### JSON Schema in Hypermedia Environments +#### JSON Schema in Hypermedia Environments These changes are not relevant to many Validation use cases, and are more of interest to Hyper-Schema users. However, even without Hyper-Schema, if you are accessing instance documents over HTTP or through other hypermedia environments, you may find this section useful. -#### Linking Instances and Schemas +##### Linking Instances and Schemas After discussions with the author of the "profile" specification, we concluded that its use for JSON Schema was not correct. The new guidance for @@ -134,7 +108,7 @@ to link instances to schemas is: "schema", like "profile" in past drafts, can also be used as a [media type parameter](../../draft-07/json-schema-core.html#rfc.section.11.2). -#### Instance Media Type +##### Instance Media Type Changes in the section are more relevant to JSON Hyper-Schema than to Validation, but as they are part of the core specification, they are diff --git a/pages/draft/2019-09/[slug].page.tsx b/pages/draft/2019-09/[slug].page.tsx deleted file mode 100644 index d7d289a2e..000000000 --- a/pages/draft/2019-09/[slug].page.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import React from 'react'; -import Head from 'next/head'; -import { getLayout } from '~/components/Sidebar'; -import StyledMarkdown from '~/components/StyledMarkdown'; -import getStaticMarkdownPaths from '~/lib/getStaticMarkdownPaths'; -import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps'; -import { Headline1 } from '~/components/Headlines'; -import { SectionContext } from '~/context'; -import { DocsHelp } from '~/components/DocsHelp'; - -export async function getStaticPaths() { - return getStaticMarkdownPaths('pages/draft/2019-09'); -} -export async function getStaticProps(args: any) { - return getStaticMarkdownProps(args, 'pages/draft/2019-09'); -} - -export default function StaticMarkdownPage({ - frontmatter, - content, -}: { - frontmatter: any; - content: any; -}) { - const markdownFile = '_index'; - const newTitle = 'JSON Schema - ' + frontmatter.title; - - return ( - - - {newTitle} - - {frontmatter.title} - - - - ); -} -StaticMarkdownPage.getLayout = getLayout; diff --git a/pages/draft/2019-09/index.md b/pages/draft/2019-09/index.md index d579813b8..a3b421bda 100644 --- a/pages/draft/2019-09/index.md +++ b/pages/draft/2019-09/index.md @@ -7,7 +7,7 @@ Authors: - Henry Andrews - Ben Hutton - Greg Dennis -Published: 16 June 2022 +Published: 17-September-2019 Metaschema: https://json-schema.org/draft/2020-12/schema Implementations: https://bowtie.report/#/dialects/draft2020-12 Status: Stable diff --git a/pages/draft/2020-12/index.md b/pages/draft/2020-12/index.md index 228828621..0b99ac0c2 100644 --- a/pages/draft/2020-12/index.md +++ b/pages/draft/2020-12/index.md @@ -2,6 +2,15 @@ title: Draft 2020-12 type: docs specification: "https://json-schema.org/draft/2020-12/json-schema-core.html" +Authors: + - Austin Wright + - Henry Andrews + - Ben Hutton + - Greg Dennis +Published: 16 June 2022 +Metaschema: https://json-schema.org/draft/2020-12/schema +Implementations: https://bowtie.report/#/dialects/draft2020-12 +Status: Stable --- ### Introduction diff --git a/pages/migration/index.md b/pages/migration/index.md new file mode 100644 index 000000000..3dad13aa0 --- /dev/null +++ b/pages/migration/index.md @@ -0,0 +1,14 @@ +### Migrating from older drafts + +The release notes discuss the changes impacting users and implementers: + +- JSON Schema Core and Validation + - [Draft 2019-09 to Draft 2020-12](https://json-schema.org/draft/2020-12/release-notes) + - [Draft-07 to Draft 2019-09](https://json-schema.org/draft/2019-09/release-notes) + - [Draft-06 to Draft-07](https://json-schema.org/draft-07/json-schema-release-notes) + - [Draft-04 to Draft-06](https://json-schema.org/draft-06/json-schema-release-notes) +- JSON Hyper-Schema + - There was no JSON Hyper-Schema draft for 2020-12 releases. + - [Draft-07 to 2019-09](https://json-schema.org/draft/2019-09/release-notes#hyper-schema-vocabulary) + - [Draft-04 to Draft-07](https://json-schema.org/draft-07/json-hyper-schema-release-notes) + - [Draft-04 to Draft-06](https://json-schema.org/draft-06/json-hyper-schema-release-notes) diff --git a/pages/migration/index.page.tsx b/pages/migration/index.page.tsx new file mode 100644 index 000000000..f8f706c48 --- /dev/null +++ b/pages/migration/index.page.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import { getLayout } from '~/components/SiteLayout'; +import fs from 'fs'; +import matter from 'gray-matter'; +import StyledMarkdown from '~/components/StyledMarkdown'; +import { SectionContext } from '~/context'; + +export async function getStaticProps() { + const index = fs.readFileSync('pages/migration/index.md', 'utf-8'); + // const main = fs.readFileSync('pages/draft-05/release-notes.md', 'utf-8'); + const { content: indexContent, data: indexData } = matter(index); +// const { content: bodyContent } = matter(main); + + const frontmatter = { ...indexData }; + return { + props: { + blocks: { + index: indexContent, + // body: bodyContent, + }, + frontmatter, + }, + }; +} + +export default function ImplementationsPages({ + blocks, + frontmatter, +}: { + blocks: any; + frontmatter: any; +}) { + return ( + +
+

{frontmatter.title}

+

{frontmatter.type}

+

{frontmatter.Specification}

+ + + +
+
+ ); +} +ImplementationsPages.getLayout = getLayout; From 90410bfce16e306d4572b3563d879bde6dee0550 Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Thu, 18 Jul 2024 20:03:09 +0530 Subject: [PATCH 03/35] metadata syntax fixes --- components/Sidebar.tsx | 47 +++++++----------------------- pages/draft-06/index.page.tsx | 5 +++- pages/draft-07/index.page.tsx | 5 +++- pages/draft/2020-12/index.md | 14 ++++----- pages/draft/2020-12/index.page.tsx | 15 +++++++--- pages/migration/index.page.tsx | 6 ++-- 6 files changed, 40 insertions(+), 52 deletions(-) diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 57b01d5b6..8d1efdd43 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -647,48 +647,24 @@ export const DocsNav = ({ id='specification' > - +
- - - - - - -
+ + + + + + + - - + - + /> diff --git a/pages/draft-06/index.page.tsx b/pages/draft-06/index.page.tsx index 03ee27c5b..8001b5717 100644 --- a/pages/draft-06/index.page.tsx +++ b/pages/draft-06/index.page.tsx @@ -7,7 +7,10 @@ import { SectionContext } from '~/context'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft-06/index.md', 'utf-8'); - const main = fs.readFileSync('pages/draft-06/json-schema-release-notes.md', 'utf-8'); + const main = fs.readFileSync( + 'pages/draft-06/json-schema-release-notes.md', + 'utf-8', + ); const { content: indexContent, data: indexData } = matter(index); const { content: bodyContent } = matter(main); diff --git a/pages/draft-07/index.page.tsx b/pages/draft-07/index.page.tsx index 58daf9385..246f50d20 100644 --- a/pages/draft-07/index.page.tsx +++ b/pages/draft-07/index.page.tsx @@ -7,7 +7,10 @@ import { SectionContext } from '~/context'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft-07/index.md', 'utf-8'); - const main = fs.readFileSync('pages/draft-07/json-schema-release-notes.md', 'utf-8'); + const main = fs.readFileSync( + 'pages/draft-07/json-schema-release-notes.md', + 'utf-8', + ); const { content: indexContent, data: indexData } = matter(index); const { content: bodyContent } = matter(main); diff --git a/pages/draft/2020-12/index.md b/pages/draft/2020-12/index.md index 0b99ac0c2..eac46dd20 100644 --- a/pages/draft/2020-12/index.md +++ b/pages/draft/2020-12/index.md @@ -1,16 +1,16 @@ --- -title: Draft 2020-12 +title: 'Draft 2020-12' +Published: '16 June 2022' type: docs -specification: "https://json-schema.org/draft/2020-12/json-schema-core.html" -Authors: +authors: - Austin Wright - Henry Andrews - Ben Hutton - Greg Dennis -Published: 16 June 2022 -Metaschema: https://json-schema.org/draft/2020-12/schema -Implementations: https://bowtie.report/#/dialects/draft2020-12 -Status: Stable +Metaschema: 'https://json-schema.org/draft/2020-12/schema' +Implementations: 'https://bowtie.report/#/dialects/draft2020-12' +Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' +Status: 'Stable' --- ### Introduction diff --git a/pages/draft/2020-12/index.page.tsx b/pages/draft/2020-12/index.page.tsx index a26e144dd..297271ff9 100644 --- a/pages/draft/2020-12/index.page.tsx +++ b/pages/draft/2020-12/index.page.tsx @@ -33,10 +33,17 @@ export default function ImplementationsPages({ return (
-

{frontmatter.title}

-

{frontmatter.type}

-

{frontmatter.Specification}

- + {/* META DATA TESTING */} +
+

{frontmatter.title}

+

{frontmatter.Published}

+

{frontmatter.type}

+

{frontmatter.authors}

+

{frontmatter.Metaschema}

+

{frontmatter.Implementations}

+

{frontmatter.Specification}

+

{frontmatter.Status}

+
diff --git a/pages/migration/index.page.tsx b/pages/migration/index.page.tsx index f8f706c48..7b85f7534 100644 --- a/pages/migration/index.page.tsx +++ b/pages/migration/index.page.tsx @@ -7,16 +7,16 @@ import { SectionContext } from '~/context'; export async function getStaticProps() { const index = fs.readFileSync('pages/migration/index.md', 'utf-8'); - // const main = fs.readFileSync('pages/draft-05/release-notes.md', 'utf-8'); + // const main = fs.readFileSync('pages/draft-05/release-notes.md', 'utf-8'); const { content: indexContent, data: indexData } = matter(index); -// const { content: bodyContent } = matter(main); + // const { content: bodyContent } = matter(main); const frontmatter = { ...indexData }; return { props: { blocks: { index: indexContent, - // body: bodyContent, + // body: bodyContent, }, frontmatter, }, From 49c5145355ee6b57b2e2d4953f6e0f98666840e9 Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe Date: Fri, 19 Jul 2024 11:12:23 +0100 Subject: [PATCH 04/35] modified spec docs --- components/Sidebar.tsx | 4 +-- pages/draft/2020-12/index.md | 12 ++++++- pages/json-hyper-schema/index.md | 8 +++++ pages/json-hyper-schema/index.page.tsx | 46 ++++++++++++++++++++++++++ pages/migration/index.md | 13 +++----- pages/release-note/index.md | 12 +++++++ pages/release-note/index.page.tsx | 46 ++++++++++++++++++++++++++ 7 files changed, 129 insertions(+), 12 deletions(-) create mode 100644 pages/json-hyper-schema/index.md create mode 100644 pages/json-hyper-schema/index.page.tsx create mode 100644 pages/release-note/index.md create mode 100644 pages/release-note/index.page.tsx diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 8d1efdd43..fd1a035eb 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -666,13 +666,13 @@ export const DocsNav = ({ diff --git a/pages/draft/2020-12/index.md b/pages/draft/2020-12/index.md index eac46dd20..d90d23d5e 100644 --- a/pages/draft/2020-12/index.md +++ b/pages/draft/2020-12/index.md @@ -15,7 +15,17 @@ Status: 'Stable' ### Introduction -[Placeholder text] +The JSON Schema Draft 2020-12 is a comprehensive update to the previous [draft 2019-09](draft/2019-09), addressing feedback and implementation experiences. This draft introduces features to simplify creating and validating JSON schemas. + +Here's an overview of updates to Draft 2020-12; + +- **Redesigned Array and Tuple Keywords**: The `items` and `additionalItems` keywords have been replaced by `prefixItems` and `items`. +- **Dynamic References**: The introduction of `$dynamicRef` and `$dynamicAnchor` replaces the older `$recursiveRef` and `$recursiveAnchor`. +- **Contains and UnevaluatedItems**: Specifies how the `contains` keyword affects the `unevaluatedItems` keyword. +- **Regular Expressions**: Now expected to support Unicode characters, addressing inconsistencies in previous drafts. +- **Media Type Changes**: Drops the schema media type parameter. +- **Embedded Schemas and Bundling**: Provides guidance on bundling schemas into a Compound Schema Document. +- **Vocabulary Changes**: Separates the `format` vocabulary into `format-annotation` and `format-assertion`. ### Access all data connected to Draft 2020-12 diff --git a/pages/json-hyper-schema/index.md b/pages/json-hyper-schema/index.md new file mode 100644 index 000000000..9cdbac5b7 --- /dev/null +++ b/pages/json-hyper-schema/index.md @@ -0,0 +1,8 @@ +--- +--- + +- JSON Hyper-Schema + - There was no JSON Hyper-Schema draft for 2020-12 releases. + - [Draft-07 to 2019-09](https://json-schema.org/draft/2019-09/release-notes#hyper-schema-vocabulary) + - [Draft-04 to Draft-07](https://json-schema.org/draft-07/json-hyper-schema-release-notes) + - [Draft-04 to Draft-06](https://json-schema.org/draft-06/json-hyper-schema-release-notes) diff --git a/pages/json-hyper-schema/index.page.tsx b/pages/json-hyper-schema/index.page.tsx new file mode 100644 index 000000000..d67ce38ed --- /dev/null +++ b/pages/json-hyper-schema/index.page.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import { getLayout } from '~/components/SiteLayout'; +import fs from 'fs'; +import matter from 'gray-matter'; +import StyledMarkdown from '~/components/StyledMarkdown'; +import { SectionContext } from '~/context'; + +export async function getStaticProps() { + const index = fs.readFileSync('pages/json-hyper-schema/index.md', 'utf-8'); + // const main = fs.readFileSync('pages/draft-05/release-notes.md', 'utf-8'); + const { content: indexContent, data: indexData } = matter(index); + // const { content: bodyContent } = matter(main); + + const frontmatter = { ...indexData }; + return { + props: { + blocks: { + index: indexContent, + // body: bodyContent, + }, + frontmatter, + }, + }; +} + +export default function ImplementationsPages({ + blocks, + frontmatter, +}: { + blocks: any; + frontmatter: any; +}) { + return ( + +
+

{frontmatter.title}

+

{frontmatter.type}

+

{frontmatter.Specification}

+ + + +
+
+ ); +} +ImplementationsPages.getLayout = getLayout; diff --git a/pages/migration/index.md b/pages/migration/index.md index 3dad13aa0..d2f6a8686 100644 --- a/pages/migration/index.md +++ b/pages/migration/index.md @@ -3,12 +3,7 @@ The release notes discuss the changes impacting users and implementers: - JSON Schema Core and Validation - - [Draft 2019-09 to Draft 2020-12](https://json-schema.org/draft/2020-12/release-notes) - - [Draft-07 to Draft 2019-09](https://json-schema.org/draft/2019-09/release-notes) - - [Draft-06 to Draft-07](https://json-schema.org/draft-07/json-schema-release-notes) - - [Draft-04 to Draft-06](https://json-schema.org/draft-06/json-schema-release-notes) -- JSON Hyper-Schema - - There was no JSON Hyper-Schema draft for 2020-12 releases. - - [Draft-07 to 2019-09](https://json-schema.org/draft/2019-09/release-notes#hyper-schema-vocabulary) - - [Draft-04 to Draft-07](https://json-schema.org/draft-07/json-hyper-schema-release-notes) - - [Draft-04 to Draft-06](https://json-schema.org/draft-06/json-hyper-schema-release-notes) + - [Draft 2019-09 to Draft 2020-12](draft/2020-12#draft-2020-12-release-notes) + - [Draft-07 to Draft 2019-09](draft/2019-09#draft-2019-09-release-note) + - [Draft-06 to Draft-07](draft-07#draft-07-release-note) + - [Draft-04 to Draft-06](draft-06#draft-06-release-note) diff --git a/pages/release-note/index.md b/pages/release-note/index.md new file mode 100644 index 000000000..b8dbe3afa --- /dev/null +++ b/pages/release-note/index.md @@ -0,0 +1,12 @@ +--- +title: Release notes +type: docs +--- + +### JSON Schema release notes for all drafts + +- [Draft 2020-12 release notes](draft/2020-12#draft-2020-12-release-notes) +- [Draft 2019-09 release notes](draft/2019-09#draft-2019-09-release-note) +- [Draft-07 release notes](draft-07#draft-07-release-note) +- [Draft-06 release notes](draft-06#draft-06-release-note) +- [Draft-05 release notes](draft-05#explanation-for-lack-of-draft-05-meta-schemas) diff --git a/pages/release-note/index.page.tsx b/pages/release-note/index.page.tsx new file mode 100644 index 000000000..b3bbf9d7f --- /dev/null +++ b/pages/release-note/index.page.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import { getLayout } from '~/components/SiteLayout'; +import fs from 'fs'; +import matter from 'gray-matter'; +import StyledMarkdown from '~/components/StyledMarkdown'; +import { SectionContext } from '~/context'; + +export async function getStaticProps() { + const index = fs.readFileSync('pages/release-note/index.md', 'utf-8'); + // const main = fs.readFileSync('pages/draft-05/release-notes.md', 'utf-8'); + const { content: indexContent, data: indexData } = matter(index); + // const { content: bodyContent } = matter(main); + + const frontmatter = { ...indexData }; + return { + props: { + blocks: { + index: indexContent, + // body: bodyContent, + }, + frontmatter, + }, + }; +} + +export default function ImplementationsPages({ + blocks, + frontmatter, +}: { + blocks: any; + frontmatter: any; +}) { + return ( + +
+

{frontmatter.title}

+

{frontmatter.type}

+

{frontmatter.Specification}

+ + + +
+
+ ); +} +ImplementationsPages.getLayout = getLayout; From 902d0aece97cc59d6097de76cc190139b384b598 Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Mon, 22 Jul 2024 12:20:01 +0530 Subject: [PATCH 05/35] adding table component --- components/DocTable.tsx | 50 ++++++++++++++++++++++++++++++ pages/draft/2019-09/index.page.tsx | 2 +- pages/draft/2020-12/index.md | 6 +--- pages/draft/2020-12/index.page.tsx | 10 +++--- 4 files changed, 58 insertions(+), 10 deletions(-) create mode 100644 components/DocTable.tsx diff --git a/components/DocTable.tsx b/components/DocTable.tsx new file mode 100644 index 000000000..1736ff103 --- /dev/null +++ b/components/DocTable.tsx @@ -0,0 +1,50 @@ +import React from 'react'; + +const DocTable = ({ frontmatter }: any) => { + return ( + <> +
+ + + + + + + + + + + + + + + + + + + +
+ Specification + + {frontmatter.Specification} +
+ Authors + + {frontmatter.authors.map((author: string, index: number) => { + return
{author}
; + })} +
+ Metaschema + + {frontmatter.Metaschema} +
+ Implementations + + {frontmatter.Implementations} +
+
+ + ); +}; + +export default DocTable; diff --git a/pages/draft/2019-09/index.page.tsx b/pages/draft/2019-09/index.page.tsx index 719e4f700..d76b53466 100644 --- a/pages/draft/2019-09/index.page.tsx +++ b/pages/draft/2019-09/index.page.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { getLayout } from '~/components/SiteLayout'; +import { getLayout } from '~/components/Sidebar'; import fs from 'fs'; import matter from 'gray-matter'; import StyledMarkdown from '~/components/StyledMarkdown'; diff --git a/pages/draft/2020-12/index.md b/pages/draft/2020-12/index.md index eac46dd20..26cf7deac 100644 --- a/pages/draft/2020-12/index.md +++ b/pages/draft/2020-12/index.md @@ -2,11 +2,7 @@ title: 'Draft 2020-12' Published: '16 June 2022' type: docs -authors: - - Austin Wright - - Henry Andrews - - Ben Hutton - - Greg Dennis +authors: ['Austin Wright', 'Henry Andrews', 'Ben Hutton', 'Greg Dennis'] Metaschema: 'https://json-schema.org/draft/2020-12/schema' Implementations: 'https://bowtie.report/#/dialects/draft2020-12' Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' diff --git a/pages/draft/2020-12/index.page.tsx b/pages/draft/2020-12/index.page.tsx index 297271ff9..b2dcfa6b0 100644 --- a/pages/draft/2020-12/index.page.tsx +++ b/pages/draft/2020-12/index.page.tsx @@ -1,9 +1,10 @@ import React from 'react'; -import { getLayout } from '~/components/SiteLayout'; +import { getLayout } from '~/components/Sidebar'; import fs from 'fs'; import matter from 'gray-matter'; import StyledMarkdown from '~/components/StyledMarkdown'; import { SectionContext } from '~/context'; +import DocTable from '~/components/DocTable'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft/2020-12/index.md', 'utf-8'); @@ -33,8 +34,7 @@ export default function ImplementationsPages({ return (
- {/* META DATA TESTING */} -
+ {/*

{frontmatter.title}

{frontmatter.Published}

{frontmatter.type}

@@ -43,7 +43,9 @@ export default function ImplementationsPages({

{frontmatter.Implementations}

{frontmatter.Specification}

{frontmatter.Status}

-
+
*/} + +
From 0e870865b6c6a24324dcd6ff6a1e5f9dbe27e762 Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Mon, 22 Jul 2024 15:37:50 +0530 Subject: [PATCH 06/35] adding title --- pages/draft/2020-12/index.page.tsx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/pages/draft/2020-12/index.page.tsx b/pages/draft/2020-12/index.page.tsx index b2dcfa6b0..635bbfe08 100644 --- a/pages/draft/2020-12/index.page.tsx +++ b/pages/draft/2020-12/index.page.tsx @@ -5,6 +5,7 @@ import matter from 'gray-matter'; import StyledMarkdown from '~/components/StyledMarkdown'; import { SectionContext } from '~/context'; import DocTable from '~/components/DocTable'; +import { Headline1 } from '~/components/Headlines'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft/2020-12/index.md', 'utf-8'); @@ -33,18 +34,8 @@ export default function ImplementationsPages({ }) { return ( -
- {/*
-

{frontmatter.title}

-

{frontmatter.Published}

-

{frontmatter.type}

-

{frontmatter.authors}

-

{frontmatter.Metaschema}

-

{frontmatter.Implementations}

-

{frontmatter.Specification}

-

{frontmatter.Status}

-
*/} - +
+ {frontmatter.title} From bfcea46f7682e9565805ab01fbb088249a279cc2 Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe Date: Mon, 22 Jul 2024 11:18:00 +0100 Subject: [PATCH 07/35] Spec draft fixes-2 --- pages/draft-05/index.md | 6 +----- pages/draft-05/index.page.tsx | 15 +++++++++++---- pages/draft-06/index.md | 8 ++------ pages/draft-06/index.page.tsx | 20 ++++++++++++-------- pages/draft-07/index.md | 16 ++++++++-------- pages/draft-07/index.page.tsx | 20 ++++++++++++-------- pages/draft/2019-09/index.md | 6 ++++-- pages/draft/2019-09/index.page.tsx | 15 +++++++++++---- pages/json-hyper-schema/index.md | 2 ++ 9 files changed, 63 insertions(+), 45 deletions(-) diff --git a/pages/draft-05/index.md b/pages/draft-05/index.md index 7942e6340..176d88e65 100644 --- a/pages/draft-05/index.md +++ b/pages/draft-05/index.md @@ -2,7 +2,7 @@ title: Draft-05 type: docs Specification: https://json-schema.org/draft/2020-12/json-schema-core.html -Authors: +authors: - Austin Wright - Henry Andrews - Ben Hutton @@ -13,10 +13,6 @@ Implementations: https://bowtie.report/#/dialects/draft2020-12 Status: Stable --- -### Introduction - -[Placeholder text] - ### Access all data connected to draft 05 - Core: [draft-wright-json-schema-00](https://json-schema.org/draft-05/draft-wright-json-schema-00.pdf) ([changes](https://json-schema.org/draft-05/draft-wright-json-schema-00.pdf#appendix-B)) diff --git a/pages/draft-05/index.page.tsx b/pages/draft-05/index.page.tsx index c37729cc4..b73c97a36 100644 --- a/pages/draft-05/index.page.tsx +++ b/pages/draft-05/index.page.tsx @@ -33,10 +33,17 @@ export default function ImplementationsPages({ return (
-

{frontmatter.title}

-

{frontmatter.type}

-

{frontmatter.Specification}

- + {/* META DATA TESTING */} +
+

{frontmatter.title}

+

{frontmatter.Published}

+

{frontmatter.type}

+

{frontmatter.authors}

+

{frontmatter.Metaschema}

+

{frontmatter.Implementations}

+

{frontmatter.Specification}

+

{frontmatter.Status}

+
diff --git a/pages/draft-06/index.md b/pages/draft-06/index.md index 7e2a768ed..e0acaa161 100644 --- a/pages/draft-06/index.md +++ b/pages/draft-06/index.md @@ -2,7 +2,7 @@ title: Draft-06 type: docs Specification: https://json-schema.org/draft/2020-12/json-schema-core.html -Authors: +authors: - Austin Wright - Henry Andrews - Ben Hutton @@ -13,11 +13,7 @@ Implementations: https://bowtie.report/#/dialects/draft2020-12 Status: Stable --- -### Introduction - -[Placeholder text] - -### Access all data connected to draft 2019-09 +### Access all data connected to draft-06 - Validation: [draft-wright-json-schema-validation-01](https://json-schema.org/draft-06/draft-wright-json-schema-validation-01.html) ([changes](https://json-schema.org/draft-06/draft-wright-json-schema-validation-01.html#rfc.appendix.B)) ([schema migration FAQ](https://json-schema.org/draft-06/json-schema-release-notes)) - Hyper-Schema: [draft-wright-json-schema-hyperschema-01](https://json-schema.org/draft-06/draft-wright-json-schema-hyperschema-01.html) ([changes](https://json-schema.org/draft-06/draft-wright-json-schema-hyperschema-01.html#rfc.appendix.B)) ([hyper-schema migration FAQ](https://json-schema.org/draft-06/json-hyper-schema-release-notes)) diff --git a/pages/draft-06/index.page.tsx b/pages/draft-06/index.page.tsx index 8001b5717..91020be4d 100644 --- a/pages/draft-06/index.page.tsx +++ b/pages/draft-06/index.page.tsx @@ -7,10 +7,7 @@ import { SectionContext } from '~/context'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft-06/index.md', 'utf-8'); - const main = fs.readFileSync( - 'pages/draft-06/json-schema-release-notes.md', - 'utf-8', - ); + const main = fs.readFileSync('pages/draft-06/json-schema-release-notes.md', 'utf-8'); const { content: indexContent, data: indexData } = matter(index); const { content: bodyContent } = matter(main); @@ -36,10 +33,17 @@ export default function ImplementationsPages({ return (
-

{frontmatter.title}

-

{frontmatter.type}

-

{frontmatter.Specification}

- + {/* META DATA TESTING */} +
+

{frontmatter.title}

+

{frontmatter.Published}

+

{frontmatter.type}

+

{frontmatter.authors}

+

{frontmatter.Metaschema}

+

{frontmatter.Implementations}

+

{frontmatter.Specification}

+

{frontmatter.Status}

+
diff --git a/pages/draft-07/index.md b/pages/draft-07/index.md index 05d762bfc..406c55e28 100644 --- a/pages/draft-07/index.md +++ b/pages/draft-07/index.md @@ -1,21 +1,21 @@ --- -title: Draft 07 +title: 'Draft 07' +Published: '19-March-2018' type: docs -specification: "https://json-schema.org/draft/2020-12/json-schema-core.html" -Authors: +authors: - Austin Wright - Henry Andrews - Ben Hutton - Greg Dennis -Published: 19-March-2018 -Metaschema: https://json-schema.org/draft/2020-12/schema -Implementations: https://bowtie.report/#/dialects/draft2020-12 -Status: Stable +Metaschema: 'https://json-schema.org/draft/2020-12/schema' +Implementations: 'https://bowtie.report/#/dialects/draft2020-12' +Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' +Status: 'Stable' --- ### Introduction -[Placeholder text] +The JSON Schema Draft-07 introduces various updates to enhance the functionality of JSON Schemas in contrast to maintaining backward compatibility with Draft-06. ### Access all data connected to draft 07 diff --git a/pages/draft-07/index.page.tsx b/pages/draft-07/index.page.tsx index 246f50d20..188e4f360 100644 --- a/pages/draft-07/index.page.tsx +++ b/pages/draft-07/index.page.tsx @@ -7,10 +7,7 @@ import { SectionContext } from '~/context'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft-07/index.md', 'utf-8'); - const main = fs.readFileSync( - 'pages/draft-07/json-schema-release-notes.md', - 'utf-8', - ); + const main = fs.readFileSync('pages/draft-07/json-schema-release-notes.md', 'utf-8'); const { content: indexContent, data: indexData } = matter(index); const { content: bodyContent } = matter(main); @@ -36,10 +33,17 @@ export default function ImplementationsPages({ return (
-

{frontmatter.title}

-

{frontmatter.type}

-

{frontmatter.Specification}

- + {/* META DATA TESTING */} +
+

{frontmatter.title}

+

{frontmatter.Published}

+

{frontmatter.type}

+

{frontmatter.authors}

+

{frontmatter.Metaschema}

+

{frontmatter.Implementations}

+

{frontmatter.Specification}

+

{frontmatter.Status}

+
diff --git a/pages/draft/2019-09/index.md b/pages/draft/2019-09/index.md index a3b421bda..175b345dc 100644 --- a/pages/draft/2019-09/index.md +++ b/pages/draft/2019-09/index.md @@ -2,7 +2,7 @@ title: Draft 2019-09 section: docs Specification: https://json-schema.org/draft/2020-12/json-schema-core.html -Authors: +authors: - Austin Wright - Henry Andrews - Ben Hutton @@ -15,7 +15,9 @@ Status: Stable ### Introduction -[Placeholder text] +The JSON Schema Draft 2019-09 introduces updates and changes to improve the reliability of JSON Schema specifications. This draft builds upon previous versions. + +One significant update is the shift to HTTPS for all meta-schema URIs. While the URIs remain accessible over HTTP due to certain limitations, the recommended standard is now firmly HTTPS. ### Access all data connected to draft 2019-09 diff --git a/pages/draft/2019-09/index.page.tsx b/pages/draft/2019-09/index.page.tsx index 719e4f700..9fc222d4a 100644 --- a/pages/draft/2019-09/index.page.tsx +++ b/pages/draft/2019-09/index.page.tsx @@ -33,10 +33,17 @@ export default function ImplementationsPages({ return (
-

{frontmatter.title}

-

{frontmatter.type}

-

{frontmatter.Specification}

- + {/* META DATA TESTING */} +
+

{frontmatter.title}

+

{frontmatter.Published}

+

{frontmatter.type}

+

{frontmatter.authors}

+

{frontmatter.Metaschema}

+

{frontmatter.Implementations}

+

{frontmatter.Specification}

+

{frontmatter.Status}

+
diff --git a/pages/json-hyper-schema/index.md b/pages/json-hyper-schema/index.md index 9cdbac5b7..ecaa28365 100644 --- a/pages/json-hyper-schema/index.md +++ b/pages/json-hyper-schema/index.md @@ -1,4 +1,6 @@ --- +title: JSON Hyper-Schema +type: docs --- - JSON Hyper-Schema From bcd01d5ba9e67b48baf4ee6125d5fd3a155fd480 Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe Date: Mon, 22 Jul 2024 15:27:29 +0100 Subject: [PATCH 08/35] Spec draft fixes-3 --- components/DocTable.tsx | 8 ++++++++ pages/draft-05/index.page.tsx | 19 ++++++------------- pages/draft-06/index.page.tsx | 19 ++++++------------- pages/draft-07/index.page.tsx | 19 ++++++------------- pages/draft/2019-09/index.page.tsx | 17 +++++------------ pages/json-hyper-schema/index.md | 2 +- pages/json-hyper-schema/index.page.tsx | 2 +- pages/migration/index.page.tsx | 2 +- pages/release-note/index.page.tsx | 2 +- 9 files changed, 35 insertions(+), 55 deletions(-) diff --git a/components/DocTable.tsx b/components/DocTable.tsx index 1736ff103..431ed8791 100644 --- a/components/DocTable.tsx +++ b/components/DocTable.tsx @@ -14,6 +14,14 @@ const DocTable = ({ frontmatter }: any) => { {frontmatter.Specification} + + + Published + + + {frontmatter.Published} + + Authors diff --git a/pages/draft-05/index.page.tsx b/pages/draft-05/index.page.tsx index b73c97a36..4f22bc8a3 100644 --- a/pages/draft-05/index.page.tsx +++ b/pages/draft-05/index.page.tsx @@ -1,9 +1,11 @@ import React from 'react'; -import { getLayout } from '~/components/SiteLayout'; +import { getLayout } from '~/components/Sidebar'; import fs from 'fs'; import matter from 'gray-matter'; import StyledMarkdown from '~/components/StyledMarkdown'; import { SectionContext } from '~/context'; +import DocTable from '~/components/DocTable'; +import { Headline1 } from '~/components/Headlines'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft-05/index.md', 'utf-8'); @@ -32,18 +34,9 @@ export default function ImplementationsPages({ }) { return ( -
- {/* META DATA TESTING */} -
-

{frontmatter.title}

-

{frontmatter.Published}

-

{frontmatter.type}

-

{frontmatter.authors}

-

{frontmatter.Metaschema}

-

{frontmatter.Implementations}

-

{frontmatter.Specification}

-

{frontmatter.Status}

-
+
+ {frontmatter.title} +
diff --git a/pages/draft-06/index.page.tsx b/pages/draft-06/index.page.tsx index 91020be4d..c0f44c3be 100644 --- a/pages/draft-06/index.page.tsx +++ b/pages/draft-06/index.page.tsx @@ -1,9 +1,11 @@ import React from 'react'; -import { getLayout } from '~/components/SiteLayout'; +import { getLayout } from '~/components/Sidebar'; import fs from 'fs'; import matter from 'gray-matter'; import StyledMarkdown from '~/components/StyledMarkdown'; import { SectionContext } from '~/context'; +import DocTable from '~/components/DocTable'; +import { Headline1 } from '~/components/Headlines'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft-06/index.md', 'utf-8'); @@ -32,18 +34,9 @@ export default function ImplementationsPages({ }) { return ( -
- {/* META DATA TESTING */} -
-

{frontmatter.title}

-

{frontmatter.Published}

-

{frontmatter.type}

-

{frontmatter.authors}

-

{frontmatter.Metaschema}

-

{frontmatter.Implementations}

-

{frontmatter.Specification}

-

{frontmatter.Status}

-
+
+ {frontmatter.title} +
diff --git a/pages/draft-07/index.page.tsx b/pages/draft-07/index.page.tsx index 188e4f360..e329b8549 100644 --- a/pages/draft-07/index.page.tsx +++ b/pages/draft-07/index.page.tsx @@ -1,9 +1,11 @@ import React from 'react'; -import { getLayout } from '~/components/SiteLayout'; +import { getLayout } from '~/components/Sidebar'; import fs from 'fs'; import matter from 'gray-matter'; import StyledMarkdown from '~/components/StyledMarkdown'; import { SectionContext } from '~/context'; +import DocTable from '~/components/DocTable'; +import { Headline1 } from '~/components/Headlines'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft-07/index.md', 'utf-8'); @@ -32,18 +34,9 @@ export default function ImplementationsPages({ }) { return ( -
- {/* META DATA TESTING */} -
-

{frontmatter.title}

-

{frontmatter.Published}

-

{frontmatter.type}

-

{frontmatter.authors}

-

{frontmatter.Metaschema}

-

{frontmatter.Implementations}

-

{frontmatter.Specification}

-

{frontmatter.Status}

-
+
+ {frontmatter.title} +
diff --git a/pages/draft/2019-09/index.page.tsx b/pages/draft/2019-09/index.page.tsx index 015152d8a..4d5808c21 100644 --- a/pages/draft/2019-09/index.page.tsx +++ b/pages/draft/2019-09/index.page.tsx @@ -4,6 +4,8 @@ import fs from 'fs'; import matter from 'gray-matter'; import StyledMarkdown from '~/components/StyledMarkdown'; import { SectionContext } from '~/context'; +import DocTable from '~/components/DocTable'; +import { Headline1 } from '~/components/Headlines'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft/2019-09/index.md', 'utf-8'); @@ -32,18 +34,9 @@ export default function ImplementationsPages({ }) { return ( -
- {/* META DATA TESTING */} -
-

{frontmatter.title}

-

{frontmatter.Published}

-

{frontmatter.type}

-

{frontmatter.authors}

-

{frontmatter.Metaschema}

-

{frontmatter.Implementations}

-

{frontmatter.Specification}

-

{frontmatter.Status}

-
+
+ {frontmatter.title} +
diff --git a/pages/json-hyper-schema/index.md b/pages/json-hyper-schema/index.md index ecaa28365..4dc6a7304 100644 --- a/pages/json-hyper-schema/index.md +++ b/pages/json-hyper-schema/index.md @@ -5,6 +5,6 @@ type: docs - JSON Hyper-Schema - There was no JSON Hyper-Schema draft for 2020-12 releases. - - [Draft-07 to 2019-09](https://json-schema.org/draft/2019-09/release-notes#hyper-schema-vocabulary) + - [Draft-07 to 2019-09](https://json-schema.org/draft/2019-09#hyper-schema-vocabulary) - [Draft-04 to Draft-07](https://json-schema.org/draft-07/json-hyper-schema-release-notes) - [Draft-04 to Draft-06](https://json-schema.org/draft-06/json-hyper-schema-release-notes) diff --git a/pages/json-hyper-schema/index.page.tsx b/pages/json-hyper-schema/index.page.tsx index d67ce38ed..51d632797 100644 --- a/pages/json-hyper-schema/index.page.tsx +++ b/pages/json-hyper-schema/index.page.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { getLayout } from '~/components/SiteLayout'; +import { getLayout } from '~/components/Sidebar'; import fs from 'fs'; import matter from 'gray-matter'; import StyledMarkdown from '~/components/StyledMarkdown'; diff --git a/pages/migration/index.page.tsx b/pages/migration/index.page.tsx index 7b85f7534..d8926c521 100644 --- a/pages/migration/index.page.tsx +++ b/pages/migration/index.page.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { getLayout } from '~/components/SiteLayout'; +import { getLayout } from '~/components/Sidebar'; import fs from 'fs'; import matter from 'gray-matter'; import StyledMarkdown from '~/components/StyledMarkdown'; diff --git a/pages/release-note/index.page.tsx b/pages/release-note/index.page.tsx index b3bbf9d7f..f745f9325 100644 --- a/pages/release-note/index.page.tsx +++ b/pages/release-note/index.page.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { getLayout } from '~/components/SiteLayout'; +import { getLayout } from '~/components/Sidebar'; import fs from 'fs'; import matter from 'gray-matter'; import StyledMarkdown from '~/components/StyledMarkdown'; From e7730dced8f154b759f28db54c39664984a809f4 Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Tue, 23 Jul 2024 12:46:30 +0530 Subject: [PATCH 09/35] doc-table --- components/DocTable.tsx | 32 +++++++-------- pages/draft-05/index.md | 18 ++++---- pages/draft-06/index.md | 12 ++---- pages/draft-06/index.page.tsx | 5 ++- pages/draft-07/index.md | 10 ++--- pages/draft-07/index.page.tsx | 5 ++- styles/globals.css | 77 ++++++++++++++++++----------------- 7 files changed, 77 insertions(+), 82 deletions(-) diff --git a/components/DocTable.tsx b/components/DocTable.tsx index 431ed8791..d20b1b669 100644 --- a/components/DocTable.tsx +++ b/components/DocTable.tsx @@ -4,47 +4,47 @@ const DocTable = ({ frontmatter }: any) => { return ( <>
- +
- - + - - - + - - - + - - - + - - - + - diff --git a/pages/draft-05/index.md b/pages/draft-05/index.md index 176d88e65..0a13d69be 100644 --- a/pages/draft-05/index.md +++ b/pages/draft-05/index.md @@ -1,16 +1,12 @@ --- -title: Draft-05 +title: 'Draft-05' +Published: '21-April-2017' type: docs -Specification: https://json-schema.org/draft/2020-12/json-schema-core.html -authors: - - Austin Wright - - Henry Andrews - - Ben Hutton - - Greg Dennis -Published: 21-April-2017 -Metaschema: https://json-schema.org/draft/2020-12/schema -Implementations: https://bowtie.report/#/dialects/draft2020-12 -Status: Stable +authors: ['Austin Wright', 'Henry Andrews', 'Ben Hutton', 'Greg Dennis'] +Metaschema: 'https://json-schema.org/draft/2020-12/schema' +Implementations: 'https://bowtie.report/#/dialects/draft2020-12' +Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' +Status: 'Stable' --- ### Access all data connected to draft 05 diff --git a/pages/draft-06/index.md b/pages/draft-06/index.md index e0acaa161..bdbb2b05a 100644 --- a/pages/draft-06/index.md +++ b/pages/draft-06/index.md @@ -1,14 +1,10 @@ --- -title: Draft-06 +title: 'Draft-06' +Published: '21-April-2017' type: docs -Specification: https://json-schema.org/draft/2020-12/json-schema-core.html -authors: - - Austin Wright - - Henry Andrews - - Ben Hutton - - Greg Dennis -Published: 21-April-2017 +authors: ['Austin Wright', 'Henry Andrews', 'Ben Hutton', 'Greg Dennis'] Metaschema: https://json-schema.org/draft/2020-12/schema +Specification: https://json-schema.org/draft/2020-12/json-schema-core.html Implementations: https://bowtie.report/#/dialects/draft2020-12 Status: Stable --- diff --git a/pages/draft-06/index.page.tsx b/pages/draft-06/index.page.tsx index c0f44c3be..057ab1d4d 100644 --- a/pages/draft-06/index.page.tsx +++ b/pages/draft-06/index.page.tsx @@ -9,7 +9,10 @@ import { Headline1 } from '~/components/Headlines'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft-06/index.md', 'utf-8'); - const main = fs.readFileSync('pages/draft-06/json-schema-release-notes.md', 'utf-8'); + const main = fs.readFileSync( + 'pages/draft-06/json-schema-release-notes.md', + 'utf-8', + ); const { content: indexContent, data: indexData } = matter(index); const { content: bodyContent } = matter(main); diff --git a/pages/draft-07/index.md b/pages/draft-07/index.md index 406c55e28..5b3909e0c 100644 --- a/pages/draft-07/index.md +++ b/pages/draft-07/index.md @@ -1,12 +1,8 @@ --- -title: 'Draft 07' -Published: '19-March-2018' +title: 'Draft-07' type: docs -authors: - - Austin Wright - - Henry Andrews - - Ben Hutton - - Greg Dennis +Published: '19-March-2018' +authors: ['Austin Wright', 'Henry Andrews', 'Ben Hutton', 'Greg Dennis'] Metaschema: 'https://json-schema.org/draft/2020-12/schema' Implementations: 'https://bowtie.report/#/dialects/draft2020-12' Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' diff --git a/pages/draft-07/index.page.tsx b/pages/draft-07/index.page.tsx index e329b8549..cf049c509 100644 --- a/pages/draft-07/index.page.tsx +++ b/pages/draft-07/index.page.tsx @@ -9,7 +9,10 @@ import { Headline1 } from '~/components/Headlines'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft-07/index.md', 'utf-8'); - const main = fs.readFileSync('pages/draft-07/json-schema-release-notes.md', 'utf-8'); + const main = fs.readFileSync( + 'pages/draft-07/json-schema-release-notes.md', + 'utf-8', + ); const { content: indexContent, data: indexData } = matter(index); const { content: bodyContent } = matter(main); diff --git a/styles/globals.css b/styles/globals.css index 6dbf621c1..ef2143bfd 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -45,40 +45,39 @@ html { } /* .herobtn { */ - /* background-color: transparent !important; */ - /* justify-content: center; */ - /* width: 168px; */ - /* height: 32px; */ - /* padding: 8px 8px; */ - /* margin-right: 10px; */ - /* display: flex; */ - /* border: 1px solid #E3E8EE; +/* background-color: transparent !important; */ +/* justify-content: center; */ +/* width: 168px; */ +/* height: 32px; */ +/* padding: 8px 8px; */ +/* margin-right: 10px; */ +/* display: flex; */ +/* border: 1px solid #E3E8EE; border-radius: 4px; */ /* } */ /* @media (max-width: 1027px) { */ - .DocSearch-Button-Container { - height: 40px; - padding: 0px; - border: none; - } +.DocSearch-Button-Container { + height: 40px; + padding: 0px; + border: none; +} - .DocSearch-Button { - margin: 0; - width: 39px; - } +.DocSearch-Button { + margin: 0; + width: 39px; +} - .DocSearch-Button-Placeholder { - display: none; - } +.DocSearch-Button-Placeholder { + display: none; +} - .DocSearch-Search-Icon { - width: 20px; - height: 20px; - } - +.DocSearch-Search-Icon { + width: 20px; + height: 20px; +} - /* .herobtn .DocSearch-Button-Container { +/* .herobtn .DocSearch-Button-Container { margin-right: 4px; margin-left: 4px; } */ @@ -101,14 +100,20 @@ border-radius: 4px; */ /** Style Algolia */ -.keygrad{ - --docsearch-key-gradient: linear-gradient(-225deg, #d5dbe4, #f8f8f8) !important; +.keygrad { + --docsearch-key-gradient: linear-gradient( + -225deg, + #d5dbe4, + #f8f8f8 + ) !important; } -.keyshadow{ - --docsearch-key-shadow: inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 2px 1px rgba(30,35,90,0.4) !important; +.keyshadow { + --docsearch-key-shadow: inset 0 -2px 0 0 #cdcde6, inset 0 0 1px 1px #fff, + 0 1px 2px 1px rgba(30, 35, 90, 0.4) !important; } -.keyshadow[data-theme=dark]{ - --docsearch-key-shadow: inset 0 -2px 0 0 #ffffff, inset 0 0 1px 1px #ffffff, 0 2px 2px 0 rgba(3, 4, 9, 0.3) !important; +.keyshadow[data-theme='dark'] { + --docsearch-key-shadow: inset 0 -2px 0 0 #ffffff, inset 0 0 1px 1px #ffffff, + 0 2px 2px 0 rgba(3, 4, 9, 0.3) !important; } .search-input { @@ -140,8 +145,6 @@ border-radius: 4px; */ margin-left: 40px; } - - .search-input span { margin-left: 15px; } @@ -222,10 +225,8 @@ border-radius: 4px; */ margin-top: 4.4rem; } - -@layer base{ +@layer base { body { - @apply dark:bg-slate-800 bg-white; + @apply dark:bg-slate-800 bg-white; } } - From 1d5f9dfbe7d6deba5f08707c2d4eccba600c8c87 Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Tue, 23 Jul 2024 12:51:28 +0530 Subject: [PATCH 10/35] fixing draft7 --- pages/draft-06/index.md | 10 +++++----- pages/draft-07/index.md | 2 +- pages/draft-07/index.page.tsx | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pages/draft-06/index.md b/pages/draft-06/index.md index bdbb2b05a..14f41a494 100644 --- a/pages/draft-06/index.md +++ b/pages/draft-06/index.md @@ -3,15 +3,15 @@ title: 'Draft-06' Published: '21-April-2017' type: docs authors: ['Austin Wright', 'Henry Andrews', 'Ben Hutton', 'Greg Dennis'] -Metaschema: https://json-schema.org/draft/2020-12/schema -Specification: https://json-schema.org/draft/2020-12/json-schema-core.html -Implementations: https://bowtie.report/#/dialects/draft2020-12 -Status: Stable +Metaschema: 'https://json-schema.org/draft/2020-12/schema' +Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' +Implementations: 'https://bowtie.report/#/dialects/draft2020-12' +Status: 'Stable' --- ### Access all data connected to draft-06 -- Validation: [draft-wright-json-schema-validation-01](https://json-schema.org/draft-06/draft-wright-json-schema-validation-01.html) ([changes](https://json-schema.org/draft-06/draft-wright-json-schema-validation-01.html#rfc.appendix.B)) ([schema migration FAQ](https://json-schema.org/draft-06/json-schema-release-notes)) +- Validation: [draft-wright-json-schema-validation-01](https://json-scheclsma.org/draft-06/draft-wright-json-schema-validation-01.html) ([changes](https://json-schema.org/draft-06/draft-wright-json-schema-validation-01.html#rfc.appendix.B)) ([schema migration FAQ](https://json-schema.org/draft-06/json-schema-release-notes)) - Hyper-Schema: [draft-wright-json-schema-hyperschema-01](https://json-schema.org/draft-06/draft-wright-json-schema-hyperschema-01.html) ([changes](https://json-schema.org/draft-06/draft-wright-json-schema-hyperschema-01.html#rfc.appendix.B)) ([hyper-schema migration FAQ](https://json-schema.org/draft-06/json-hyper-schema-release-notes)) - [JSON Schema meta-schema](https://json-schema.org/draft-06/schema) - [JSON Hyper-Schema meta-schema](https://json-schema.org/draft-06/hyper-schema) diff --git a/pages/draft-07/index.md b/pages/draft-07/index.md index 5b3909e0c..1ce9ed759 100644 --- a/pages/draft-07/index.md +++ b/pages/draft-07/index.md @@ -1,7 +1,7 @@ --- title: 'Draft-07' -type: docs Published: '19-March-2018' +type: docs authors: ['Austin Wright', 'Henry Andrews', 'Ben Hutton', 'Greg Dennis'] Metaschema: 'https://json-schema.org/draft/2020-12/schema' Implementations: 'https://bowtie.report/#/dialects/draft2020-12' diff --git a/pages/draft-07/index.page.tsx b/pages/draft-07/index.page.tsx index cf049c509..79adf0d80 100644 --- a/pages/draft-07/index.page.tsx +++ b/pages/draft-07/index.page.tsx @@ -8,7 +8,7 @@ import DocTable from '~/components/DocTable'; import { Headline1 } from '~/components/Headlines'; export async function getStaticProps() { - const index = fs.readFileSync('pages/draft-07/index.md', 'utf-8'); + const index = fs.readFileSync('pages/draft-06/index.md', 'utf-8'); const main = fs.readFileSync( 'pages/draft-07/json-schema-release-notes.md', 'utf-8', From 4df579fc18edb8362d0feec53c7c4fb8e312d3ad Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Tue, 23 Jul 2024 12:59:14 +0530 Subject: [PATCH 11/35] draft7 fix --- pages/draft-07/index.md | 2 +- pages/draft-07/index.page.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/draft-07/index.md b/pages/draft-07/index.md index 1ce9ed759..a1c8a7fba 100644 --- a/pages/draft-07/index.md +++ b/pages/draft-07/index.md @@ -4,8 +4,8 @@ Published: '19-March-2018' type: docs authors: ['Austin Wright', 'Henry Andrews', 'Ben Hutton', 'Greg Dennis'] Metaschema: 'https://json-schema.org/draft/2020-12/schema' +Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' Implementations: 'https://bowtie.report/#/dialects/draft2020-12' -Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' Status: 'Stable' --- diff --git a/pages/draft-07/index.page.tsx b/pages/draft-07/index.page.tsx index 79adf0d80..cf049c509 100644 --- a/pages/draft-07/index.page.tsx +++ b/pages/draft-07/index.page.tsx @@ -8,7 +8,7 @@ import DocTable from '~/components/DocTable'; import { Headline1 } from '~/components/Headlines'; export async function getStaticProps() { - const index = fs.readFileSync('pages/draft-06/index.md', 'utf-8'); + const index = fs.readFileSync('pages/draft-07/index.md', 'utf-8'); const main = fs.readFileSync( 'pages/draft-07/json-schema-release-notes.md', 'utf-8', From d94018b144ba2a7f8f226f0d68f367082d23c717 Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Tue, 23 Jul 2024 13:07:54 +0530 Subject: [PATCH 12/35] converting in links --- components/DocTable.tsx | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/components/DocTable.tsx b/components/DocTable.tsx index d20b1b669..906475b11 100644 --- a/components/DocTable.tsx +++ b/components/DocTable.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import Link from 'next/link'; const DocTable = ({ frontmatter }: any) => { return ( @@ -6,15 +7,22 @@ const DocTable = ({ frontmatter }: any) => {
+
Specification + {frontmatter.Specification}
+
Published + {frontmatter.Published}
+
Authors + {frontmatter.authors.map((author: string, index: number) => { return
{author}
; })}
+
Metaschema + {frontmatter.Metaschema}
+
Implementations + {frontmatter.Implementations}
- + - + @@ -22,7 +30,7 @@ const DocTable = ({ frontmatter }: any) => { {frontmatter.Published} - + @@ -32,20 +40,32 @@ const DocTable = ({ frontmatter }: any) => { })} - + - + From 68ff0c788f111fb01403bd686fb26af1747091ee Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Tue, 23 Jul 2024 14:10:15 +0530 Subject: [PATCH 13/35] adding multiple files --- pages/draft-06/index.page.tsx | 12 ++++++++++++ pages/draft-06/readme.md | 7 +------ pages/draft-07/index.page.tsx | 12 ++++++++++++ pages/draft-07/readme.md | 8 ++------ 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/pages/draft-06/index.page.tsx b/pages/draft-06/index.page.tsx index 057ab1d4d..d146c61db 100644 --- a/pages/draft-06/index.page.tsx +++ b/pages/draft-06/index.page.tsx @@ -13,8 +13,16 @@ export async function getStaticProps() { 'pages/draft-06/json-schema-release-notes.md', 'utf-8', ); + const hyperSchema = fs.readFileSync( + 'pages/draft-06/json-hyper-schema-release-notes.md', + 'utf-8', + ); + const readme = fs.readFileSync('pages/draft-06/readme.md', 'utf-8'); + const { content: indexContent, data: indexData } = matter(index); const { content: bodyContent } = matter(main); + const { content: hyperSchemaContent } = matter(hyperSchema); + const { content: readmeContent } = matter(readme); const frontmatter = { ...indexData }; return { @@ -22,6 +30,8 @@ export async function getStaticProps() { blocks: { index: indexContent, body: bodyContent, + hyperSchema: hyperSchemaContent, + readme: readmeContent, }, frontmatter, }, @@ -42,6 +52,8 @@ export default function ImplementationsPages({ + + ); diff --git a/pages/draft-06/readme.md b/pages/draft-06/readme.md index cbef1dbb0..3a7c309b7 100644 --- a/pages/draft-06/readme.md +++ b/pages/draft-06/readme.md @@ -1,7 +1,2 @@ ---- -title: Draft-06 Release Notes -section: docs ---- - - [JSON Schema Release Notes](/draft-06/json-schema-release-notes) -- [JSON Hyper-Schema Release Notes](/draft-06/json-hyper-schema-release-notes) \ No newline at end of file +- [JSON Hyper-Schema Release Notes](/draft-06/json-hyper-schema-release-notes) diff --git a/pages/draft-07/index.page.tsx b/pages/draft-07/index.page.tsx index cf049c509..d7d5ac112 100644 --- a/pages/draft-07/index.page.tsx +++ b/pages/draft-07/index.page.tsx @@ -13,8 +13,16 @@ export async function getStaticProps() { 'pages/draft-07/json-schema-release-notes.md', 'utf-8', ); + const hyperSchema = fs.readFileSync( + 'pages/draft-07/json-hyper-schema-release-notes.md', + 'utf-8', + ); + const readme = fs.readFileSync('pages/draft-07/readme.md', 'utf-8'); + const { content: indexContent, data: indexData } = matter(index); const { content: bodyContent } = matter(main); + const { content: hyperSchemaContent } = matter(hyperSchema); + const { content: readmeContent } = matter(readme); const frontmatter = { ...indexData }; return { @@ -22,6 +30,8 @@ export async function getStaticProps() { blocks: { index: indexContent, body: bodyContent, + hyperSchema: hyperSchemaContent, + readme: readmeContent, }, frontmatter, }, @@ -42,6 +52,8 @@ export default function ImplementationsPages({ + + ); diff --git a/pages/draft-07/readme.md b/pages/draft-07/readme.md index ad83f1017..a260bac9e 100644 --- a/pages/draft-07/readme.md +++ b/pages/draft-07/readme.md @@ -1,9 +1,5 @@ ---- -title: Draft-07 Release Notes -section: docs ---- +[JSON Schema Release Notes](/draft-07/json-schema-release-notes) -- [JSON Schema Release Notes](/draft-07/json-schema-release-notes) - [JSON Hyper-Schema Release Notes](/draft-07/json-hyper-schema-release-notes) -Note that the draft-handrews-\*-00 versions of JSON Hyper-Schema and Relative JSON Pointer had confusing bugs, and have been replaced by draft-handrews-\*-01 versions. The -00 versions may be found in the [obsolete](obsolete) directory. +Note that the draft-handrews-\*-00 versions of JSON Hyper-Schema and Relative JSON Pointer had confusing bugs, and have been replaced by draft-handrews-\*-01 versions. The -00 versions may be found in the [obsolete](obsolete) directory. From 58cc4cf45d900d421b496bc6e09a2da140f7f207 Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe Date: Tue, 23 Jul 2024 09:44:13 +0100 Subject: [PATCH 14/35] Spec draft fixes-4 --- pages/release-note/index.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pages/release-note/index.md b/pages/release-note/index.md index b8dbe3afa..d5db70362 100644 --- a/pages/release-note/index.md +++ b/pages/release-note/index.md @@ -1,9 +1,4 @@ ---- -title: Release notes -type: docs ---- - -### JSON Schema release notes for all drafts +### Release notes for all drafts - [Draft 2020-12 release notes](draft/2020-12#draft-2020-12-release-notes) - [Draft 2019-09 release notes](draft/2019-09#draft-2019-09-release-note) From 0e08ca76157d87286bed4fc13228e04151c0c9f5 Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe Date: Tue, 23 Jul 2024 09:57:01 +0100 Subject: [PATCH 15/35] Spec draft fixes-5 --- .../json-hyper-schema-release-notes.md | 111 +++++++++--------- .../json-hyper-schema-release-notes.md | 91 +++++++------- 2 files changed, 98 insertions(+), 104 deletions(-) diff --git a/pages/draft-06/json-hyper-schema-release-notes.md b/pages/draft-06/json-hyper-schema-release-notes.md index 19735c3a3..53def600e 100644 --- a/pages/draft-06/json-hyper-schema-release-notes.md +++ b/pages/draft-06/json-hyper-schema-release-notes.md @@ -1,107 +1,104 @@ ---- -title: JSON Hyper-Schema Draft-06 Release Notes -section: docs ---- +### JSON Hyper-Schema Draft-06 Release Notes Release notes for migrating from draft-luff-json-hyper-schema-00 (draft-04) to draft-wright-json-schema-hyperschema-01 (draft-06).
NOTE: draft-07 has been released
-The [migration notes for draft-07](../draft-07/json-hyper-schema-release-notes) give a much more straightforward overview of migrating from draft-04 to draft-07 by skipping the complicated intermediate states of draft-05 and draft-06. This page has been retained for historical interest, but it is not recommened for those who just want to get going with the latest draft. +The [migration notes for draft-07](../draft-07/json-hyper-schema-release-notes) give a much more straightforward overview of migrating from draft-04 to draft-07 by skipping the complicated intermediate states of draft-05 and draft-06. This page has been retained for historical interest, but it is not recommened for those who just want to get going with the latest draft. **For implementors:** We recommend just implementing draft-07, and not draft-06 or earlier. -* [Q: What are the incompatible changes between draft-04 and draft-06?](#q:-what-are-the-incompatible-changes-between-draft-04-and-draft-06) - * [Changes from draft-04 to draft-05](#changes-from-draft-04-to-draft-05) - * [Changes from draft-05 to draft-06](#changes-from-draft-05-to-draft-06) - * [Proper use of "targetSchema"](#proper-use-of) -* [Q: Why were several major changes made to Hyper-Schema just before draft-06’s publication?](#q:-why-were-several-major-changes-made-to-hyper-schema-just-before-draft-06's-publication) -* [Q: Why doesn’t the spec mention or behave like HTML anymore?](#q:-why-doesn't-the-spec-mention-or-behave-like-html-anymore) - * [Splitting "schema"](#splitting) - * [Removing "method"](#removing) -* [Q: So how do I indicate which HTTP methods are supported on a link?](#q:-so-how-do-i-indicate-which-http-methods-are-supported-on-a-link) -* [Q: No, really. How do I explicitly indicate which HTTP methods are supported on a link?](#q:-no-really.-how-do-i-indicate-which-http-methods-are-supported-on-a-link) -* [Q: If "targetSchema" is not the response, how do I describe responses?](#q:-if-is-not-the-response-how-do-i-describe-responses) +- [Q: What are the incompatible changes between draft-04 and draft-06?](#q:-what-are-the-incompatible-changes-between-draft-04-and-draft-06) + - [Changes from draft-04 to draft-05](#changes-from-draft-04-to-draft-05) + - [Changes from draft-05 to draft-06](#changes-from-draft-05-to-draft-06) + - [Proper use of "targetSchema"](#proper-use-of) +- [Q: Why were several major changes made to Hyper-Schema just before draft-06’s publication?](#q:-why-were-several-major-changes-made-to-hyper-schema-just-before-draft-06's-publication) +- [Q: Why doesn’t the spec mention or behave like HTML anymore?](#q:-why-doesn't-the-spec-mention-or-behave-like-html-anymore) + - [Splitting "schema"](#splitting) + - [Removing "method"](#removing) +- [Q: So how do I indicate which HTTP methods are supported on a link?](#q:-so-how-do-i-indicate-which-http-methods-are-supported-on-a-link) +- [Q: No, really. How do I explicitly indicate which HTTP methods are supported on a link?](#q:-no-really.-how-do-i-indicate-which-http-methods-are-supported-on-a-link) +- [Q: If "targetSchema" is not the response, how do I describe responses?](#q:-if-is-not-the-response-how-do-i-describe-responses) -### Q: What are the incompatible changes between draft-04 and draft-06? +#### Q: What are the incompatible changes between draft-04 and draft-06? Between drafts 04 and 06 we undertook a major re-examining of Hyper-Schema, which has never been as widely adopted as JSON Schema Validation. -While we knew that there were still major gaps in draft-06, we felt that it was a good set of changes for collecting feedback. With draft-07 published, that draft or later should be used, and draft-06 becomes an historical curiosity. +While we knew that there were still major gaps in draft-06, we felt that it was a good set of changes for collecting feedback. With draft-07 published, that draft or later should be used, and draft-06 becomes an historical curiosity. -#### Changes from draft-04 to draft-05 +##### Changes from draft-04 to draft-05 -keyword | change | consequence ----- | ---- | ---- -`"base"` | replaces looking up the nearest "self" link to determine the base URI for `"href"` | if you were relying on "self" links to change the base, set `"base"` explicitly -`"rel"` | "full" relation removed | use ["item"](https://github.com/json-schema-org/json-schema-spec/issues/295) -`"rel"` | "instances" and "create" relations removed | use ["collection"](https://github.com/json-schema-org/json-schema-spec/issues/295) -`"rel"` | "root" relation removed | use a fragment in your `"href"` URI Template -`"fragmentResolution"` | *removed* | media type determines how fragments are interpreted -`"pathStart"` | *removed* | *[no replacement]* -`"method"` | [changed back to HTML form semantics](../draft-03/draft-zyp-json-schema-03.pdf) of "get" and "post" rather than all HTTP methods | *[changed again in draft-06 due to feedback that this was confusing]* +| keyword | change | consequence | +| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `"base"` | replaces looking up the nearest "self" link to determine the base URI for `"href"` | if you were relying on "self" links to change the base, set `"base"` explicitly | +| `"rel"` | "full" relation removed | use ["item"](https://github.com/json-schema-org/json-schema-spec/issues/295) | +| `"rel"` | "instances" and "create" relations removed | use ["collection"](https://github.com/json-schema-org/json-schema-spec/issues/295) | +| `"rel"` | "root" relation removed | use a fragment in your `"href"` URI Template | +| `"fragmentResolution"` | _removed_ | media type determines how fragments are interpreted | +| `"pathStart"` | _removed_ | _[no replacement]_ | +| `"method"` | [changed back to HTML form semantics](../draft-03/draft-zyp-json-schema-03.pdf) of "get" and "post" rather than all HTTP methods | _[changed again in draft-06 due to feedback that this was confusing]_ | -#### Changes from draft-05 to draft-06 +##### Changes from draft-05 to draft-06 -keyword | change | consequence ----- | ---- | ---- -`"method"` | *removed* | for HTTP method proposals, see issues [#73](https://github.com/json-schema-org/json-schema-spec/issues/73) and [#296](https://github.com/json-schema-org/json-schema-spec/issues/296) (use either `"method"` or `"allow"` as an extension keyword if needed); indication of how to use `"schema"` and `"encType"` no longer necessary -`"schema"` | *removed* | use `"hrefSchema"`, `"submissionSchema"`, or `"targetSchema"` | -`"encType"` | *removed* | use `"submissionEncType"` for request bodies; no longer needed for URI query strings -`"hrefSchema"` | *added* | replaces `"method": "get", "schema": {...}`, with additional functionality | -`"submissionSchema"` | *added* | replaces `"method": "post", "schema": {...}` -`"submissionEncType"` | *added* | replaces `"method": "post", "encType": "..."` -`"href"` | preprocessing removed | *to be replaced and expanded in future drafts* +| keyword | change | consequence | +| --------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `"method"` | _removed_ | for HTTP method proposals, see issues [#73](https://github.com/json-schema-org/json-schema-spec/issues/73) and [#296](https://github.com/json-schema-org/json-schema-spec/issues/296) (use either `"method"` or `"allow"` as an extension keyword if needed); indication of how to use `"schema"` and `"encType"` no longer necessary | +| `"schema"` | _removed_ | use `"hrefSchema"`, `"submissionSchema"`, or `"targetSchema"` | +| `"encType"` | _removed_ | use `"submissionEncType"` for request bodies; no longer needed for URI query strings | +| `"hrefSchema"` | _added_ | replaces `"method": "get", "schema": {...}`, with additional functionality | +| `"submissionSchema"` | _added_ | replaces `"method": "post", "schema": {...}` | +| `"submissionEncType"` | _added_ | replaces `"method": "post", "encType": "..."` | +| `"href"` | preprocessing removed | _to be replaced and expanded in future drafts_ | -#### Proper use of `"targetSchema"` +##### Proper use of `"targetSchema"` -While `"targetSchema"` did not change its meaning in either recent draft, it has been widely misinterpreted. So it may feel like a change to use it as specified. +While `"targetSchema"` did not change its meaning in either recent draft, it has been widely misinterpreted. So it may feel like a change to use it as specified. -Due to draft-04 emphasizing individual HTTP methods as `"method"` values, many users interpreted `"targetSchema"` as a hint of the response to the method in `"method"`. This was never correct; all drafts define this keyword as describing the representation of the target resource, which appears as a response to HTTP GET, but may or may not appear in other responses. +Due to draft-04 emphasizing individual HTTP methods as `"method"` values, many users interpreted `"targetSchema"` as a hint of the response to the method in `"method"`. This was never correct; all drafts define this keyword as describing the representation of the target resource, which appears as a response to HTTP GET, but may or may not appear in other responses. -Draft-06 clarifies this usage and provides guidance on its use with different HTTP methods. This includes using `"targetSchema"` as a request description for PUT and PATCH. With draft-04, many users used `"schema"` to describe PUT and PATCH requests which is not needed. +Draft-06 clarifies this usage and provides guidance on its use with different HTTP methods. This includes using `"targetSchema"` as a request description for PUT and PATCH. With draft-04, many users used `"schema"` to describe PUT and PATCH requests which is not needed. -However, the [`"targetHints"` proposal](https://github.com/json-schema-org/json-schema-spec/issues/296) has been accepted into draft-07. Among other things, it enables hinting at "Accept-Patch", which is needed to properly use `"targetSchema"` with HTTP PATCH. There will be examples and detailed guidance in draft-07. +However, the [`"targetHints"` proposal](https://github.com/json-schema-org/json-schema-spec/issues/296) has been accepted into draft-07. Among other things, it enables hinting at "Accept-Patch", which is needed to properly use `"targetSchema"` with HTTP PATCH. There will be examples and detailed guidance in draft-07. -### Q: Why were several major changes made to Hyper-Schema just before draft-06's publication? +#### Q: Why were several major changes made to Hyper-Schema just before draft-06's publication? -A: During final review, it became apparent that there was no consensus on how to use the spec as written. The late changes were necessary to publish a spec with unambiguous meaning, so that we could get feedback on its contents rather than differing interpretations. Originally we attempted to simply clarify what was there, but then we realized there was no agreement on what was there in the first place. +A: During final review, it became apparent that there was no consensus on how to use the spec as written. The late changes were necessary to publish a spec with unambiguous meaning, so that we could get feedback on its contents rather than differing interpretations. Originally we attempted to simply clarify what was there, but then we realized there was no agreement on what was there in the first place. -### Q: Why doesn't the spec mention or behave like HTML anymore? +#### Q: Why doesn't the spec mention or behave like HTML anymore? A: We came to a consensus that the existing analogies caused more harm than good, for two reasons: 1. The change between draft-03 and draft-04 to let `"method"` indicate any HTTP method instead of HTML's `
` "get" and "post" values broke the original analogy to HTML, and trying to change it back was not well-received 2. Only being able to use `"schema"` and `"encType"` for either the URI query string (but no other part of the URI) or the request body, but not having any way to work with both at once, was overly restrictive for API design -#### Splitting `"schema"` +##### Splitting `"schema"` -Instead of having `"schema"` perform two different things depending on `"method"`, we split it into two keywords, one for each use. This allows using both simultaneously when needed, which is a use case not present in HTML forms. +Instead of having `"schema"` perform two different things depending on `"method"`, we split it into two keywords, one for each use. This allows using both simultaneously when needed, which is a use case not present in HTML forms. -`"hrefSchema"` replaces the `"method": "get"` use, but leverages URI Template variables so that client data-driven dynamic URIs are no longer limited to the query string. `"encType"` is no longer needed with this approach. +`"hrefSchema"` replaces the `"method": "get"` use, but leverages URI Template variables so that client data-driven dynamic URIs are no longer limited to the query string. `"encType"` is no longer needed with this approach. `"submissionSchema"` directly replaces the `"method": "post"` use, with `"submissionEncType"` replacing `"encType"`. -#### Removing `"method"` +##### Removing `"method"` -Draft-05 tried to restore the draft-03 behavior of `"method"`, but feedback told us that users found the change very confusing. With `"schema"` split, the draft-05 behavior of `"method"` was no longer needed. +Draft-05 tried to restore the draft-03 behavior of `"method"`, but feedback told us that users found the change very confusing. With `"schema"` split, the draft-05 behavior of `"method"` was no longer needed. -We could have switched by to draft-04's `"method"` behavior, but in addition to producing more confusion from all of the back and forth, the draft-04 approach to `"method"` was not consistent with the rest of the LDO design anyway. Most notably, it caused problems with the usage of `"targetSchema"` as described above. +We could have switched by to draft-04's `"method"` behavior, but in addition to producing more confusion from all of the back and forth, the draft-04 approach to `"method"` was not consistent with the rest of the LDO design anyway. Most notably, it caused problems with the usage of `"targetSchema"` as described above. -### Q: So how do I indicate which HTTP methods are supported on a link? +#### Q: So how do I indicate which HTTP methods are supported on a link? -A: Ideally, this is implicitly conveyed by your link relation type, which is the primary indicator of semantics across machine-oriented hypermedia in general. [RFC 5988](https://tools.ietf.org/html/rfc5988) provides guidance on creating custom (a.k.a. "extension") link relations. +A: Ideally, this is implicitly conveyed by your link relation type, which is the primary indicator of semantics across machine-oriented hypermedia in general. [RFC 5988](https://tools.ietf.org/html/rfc5988) provides guidance on creating custom (a.k.a. "extension") link relations. Several URI schemes and namespaces, such as the [UUID namespace in the `urn:` scheme](https://tools.ietf.org/html/rfc4122), or the [`tag:` scheme](https://tools.ietf.org/html/rfc4151), are particularly suitable for creating unique identifiers. And of course, there are ways to detect this at runtime such as HTTP's `"Allow"` response header, or attempting a method and handling a `405 Method Not Allowed` error accordingly. -### Q: No, really. How do I _explicitly_ indicate which HTTP methods are supported on a link? +#### Q: No, really. How do I _explicitly_ indicate which HTTP methods are supported on a link? A: The [`"targetHints"` proposal](https://github.com/json-schema-org/json-schema-spec/issues/296) is part of draft-07, so using it as an extension to draft-06 is an option, but we recommend simply using draft-07 at this point. -### Q: If `"targetSchema"` is not the response, how do I describe responses? +#### Q: If `"targetSchema"` is not the response, how do I describe responses? A: You should have hyper-schemas for your various success and error responses, but connecting them to links is more of a documentation question than a usage question: each response will indicate its own schema, so you don't need to know it in advance at runtime. -There has never been a Hyper-Schema keyword to explicitly associate responses with operations such as HTTP methods. The use cases for this seem to be about generating API documentation, so this is most likely a candidate for a [JSON Schema API Documentation vocabulary](https://github.com/json-schema-org/json-schema-vocabularies/issues/1). +There has never been a Hyper-Schema keyword to explicitly associate responses with operations such as HTTP methods. The use cases for this seem to be about generating API documentation, so this is most likely a candidate for a [JSON Schema API Documentation vocabulary](https://github.com/json-schema-org/json-schema-vocabularies/issues/1). diff --git a/pages/draft-07/json-hyper-schema-release-notes.md b/pages/draft-07/json-hyper-schema-release-notes.md index 4c7ec8ac5..3fb7aff68 100644 --- a/pages/draft-07/json-hyper-schema-release-notes.md +++ b/pages/draft-07/json-hyper-schema-release-notes.md @@ -1,7 +1,4 @@ ---- -title: JSON Hyper-Schema Draft-07 Release Notes -section: docs ---- +### JSON Hyper-Schema Draft-07 Release Notes JSON Hyper-Schema [draft-07](../../draft-07/json-schema-hypermedia.html) completes the reworking of Hyper-Schema that was begun in draft-06. @@ -12,56 +9,56 @@ so keywords used for other purposes (`readOnly` and `media`) have been The [new draft](../../draft-07/json-schema-hypermedia.html) has been completely rewritten for clarity and accessibility, so it is best to simply approach it as a new -proposal. We hope to add tutorial material at some point, but that is +proposal. We hope to add tutorial material at some point, but that is outside of the scope of release notes. However, if you wish to migrate from an earlier draft, this page is a guide -to the key _changes_. The additions, which are much more numerous, +to the key _changes_. The additions, which are much more numerous, should be learned directly from the new specification until we can provide tutorials. Note that draft-handrews-json-schema-hyperschema-00 has been replaced by draft-handrews-json-schema-hyperschema-01 in order to fix confusing -bugs. The newer -01 draft is **still considered to be draft-07**. +bugs. The newer -01 draft is **still considered to be draft-07**. It now references the draft-07 meta-schema with the correct URI, among -other typo fixes. There are no funcitonal changes between -00 and -01. +other typo fixes. There are no funcitonal changes between -00 and -01. -* [Migrating from draft-06](#migrating-from-draft-06) -* [Migrating from draft-05](#migrating-from-draft-05) -* [Migrating from draft-04](#migrating-from-draft-04) - * [GET](#get) - * [PUT](#put) - * [DELETE](#delete) - * [POST](#post) - * [PATCH](#patch) +- [Migrating from draft-06](#migrating-from-draft-06) +- [Migrating from draft-05](#migrating-from-draft-05) +- [Migrating from draft-04](#migrating-from-draft-04) + - [GET](#get) + - [PUT](#put) + - [DELETE](#delete) + - [POST](#post) + - [PATCH](#patch) -### Migrating from draft-06 +#### Migrating from draft-06 No draft-06 features were changed, although two keywords were renamed for clarity and consistency: -* `mediaType` -> `targetMediaType` -* `submissionEncType` -> `submissionMediaType` +- `mediaType` -> `targetMediaType` +- `submissionEncType` -> `submissionMediaType` Additionally, `hrefSchema` was somewhat confusing, so a great deal more effort has gone into explaining how it works, and how it fits into the overall link resolution process. -### Migrating from draft-05 +#### Migrating from draft-05 See the [draft-06 release notes](../../draft-06/json-hyper-schema-release-notes) for information related to draft-05. -### Migrating from draft-04 +#### Migrating from draft-04 In the ideal draft-07 world, links and [operations](https://json-schema.org/draft-07/json-schema-hypermedia.html#rfc.section.3.1) -are not the same concept. Using terminology borrowed from +are not the same concept. Using terminology borrowed from [OpenAPI's Operation Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#operationObject), HTTP methods are operations, and each link (as described by a single LDO) can support multiple operations. Therefore, unlike draft-04, draft-07 hyper-schemas -[do not have separate links for each operation](../../draft-07/json-schema-hypermedia.html#rfc.section.8.1). This makes the migration guidelines below approximate at best. +[do not have separate links for each operation](../../draft-07/json-schema-hypermedia.html#rfc.section.8.1). This makes the migration guidelines below approximate at best. For a more detailed explanation of how draft-04's `method` and `targetSchema` were typically used to create single-operation links, and how that poses @@ -79,53 +76,53 @@ means that some uses of draft-04 do not have direct analogues in draft-07. Any keyword not mentioned in a list below is unchanged for that link operation. -#### GET +##### GET -* `"method": "GET"` -> `"targetHints": {"allow": ["GET"]}` -* `mediaType` -> `targetMediaType` -* `schema` -> `hrefSchema` with parameters added to `href` -* `encType` -> drop if `application/x-www-form-urlencoded`, contact the mailing list otherwise +- `"method": "GET"` -> `"targetHints": {"allow": ["GET"]}` +- `mediaType` -> `targetMediaType` +- `schema` -> `hrefSchema` with parameters added to `href` +- `encType` -> drop if `application/x-www-form-urlencoded`, contact the mailing list otherwise -#### PUT +##### PUT If you have a PUT link where `schema`/`encType` differ from `targetSchema`/`mediaType`, where `targetSchema`/`mediaType` describe a non-representation response, then those fields do not have a direct replacement. -* `"method": "PUT"` -> `"targetHints": {"allow": ["PUT"]}` -* `schema` -> `targetSchema` -* `encType` -> `targetMediaType` +- `"method": "PUT"` -> `"targetHints": {"allow": ["PUT"]}` +- `schema` -> `targetSchema` +- `encType` -> `targetMediaType` -#### DELETE +##### DELETE DELETE does not take a request payload, so `schema` and `encType` -should be unused. If `targetSchema` and `mediaType` were being +should be unused. If `targetSchema` and `mediaType` were being used for a response other than the just-deleted resource's representation, then they do not have a direct replacement. -* `"method": "DELETE"` -> `"targetHints": {"allow": ["DELETE"]}` -* `mediaType` -> `targetMediaType` (if describing the representation) +- `"method": "DELETE"` -> `"targetHints": {"allow": ["DELETE"]}` +- `mediaType` -> `targetMediaType` (if describing the representation) -#### POST +##### POST In most cases, the response of a POST is **not** a representation of the target resource, but rather some sort of result or status of whatever -the POST attempted to do. Therefore `targetSchema` and `mediaType` -should almost certainly be dropped. Other than that: +the POST attempted to do. Therefore `targetSchema` and `mediaType` +should almost certainly be dropped. Other than that: -* `"method": "POST"` -> `"targetHints": {"allow": ["POST"]}` -* `schema` -> `submissionSchema` -* `encType` -> `submissionMediaType` +- `"method": "POST"` -> `"targetHints": {"allow": ["POST"]}` +- `schema` -> `submissionSchema` +- `encType` -> `submissionMediaType` -#### PATCH +##### PATCH It was never entirely clear how to model a proper PATCH (that uses a patch media type rather than `application/json` in the request) in Hyper-Schema. One option was to treat it identically to PUT except with the patch media type -in `encType`. Assuming that approach (and the same `taregetSchema`/`mediaType` +in `encType`. Assuming that approach (and the same `taregetSchema`/`mediaType` caveats as for PUT): -* `"method": "PATCH"` -> `"targetHints": {"allow": ["PATCH"]}` -* `schema` -> `targetSchema` -* `"encType": "..."` -> `"targetHints": {"accept-patch": "..."}` +- `"method": "PATCH"` -> `"targetHints": {"allow": ["PATCH"]}` +- `schema` -> `targetSchema` +- `"encType": "..."` -> `"targetHints": {"accept-patch": "..."}` From 15ff1ad2d3bb45f90e4ba643ba2b789e61969aab Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe Date: Tue, 23 Jul 2024 10:01:45 +0100 Subject: [PATCH 16/35] Spec draft fixes-6 --- pages/json-hyper-schema/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/json-hyper-schema/index.md b/pages/json-hyper-schema/index.md index 4dc6a7304..1be398eca 100644 --- a/pages/json-hyper-schema/index.md +++ b/pages/json-hyper-schema/index.md @@ -6,5 +6,5 @@ type: docs - JSON Hyper-Schema - There was no JSON Hyper-Schema draft for 2020-12 releases. - [Draft-07 to 2019-09](https://json-schema.org/draft/2019-09#hyper-schema-vocabulary) - - [Draft-04 to Draft-07](https://json-schema.org/draft-07/json-hyper-schema-release-notes) - - [Draft-04 to Draft-06](https://json-schema.org/draft-06/json-hyper-schema-release-notes) + - [Draft-04 to Draft-07](https://json-schema.org/draft-07#json-hyper-schema-draft-07-release-notes) + - [Draft-04 to Draft-06](https://json-schema.org/draft-06#json-hyper-schema-draft-06-release-notes) From b1fc371f71b9868c78aa522e3c0da1f0fb4aa1cc Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe Date: Thu, 25 Jul 2024 11:36:10 +0100 Subject: [PATCH 17/35] Modified spec page --- components/DocTable.tsx | 22 ++------- components/Sidebar.tsx | 15 ++++--- pages/draft-05/index.md | 4 +- pages/draft-06/index.md | 4 +- pages/draft-07/index.md | 4 +- pages/draft/2019-09/index.md | 4 +- pages/draft/2020-12/index.md | 4 +- pages/format4/body.md | 2 - pages/format4/index.md | 6 --- pages/format4/index.page.tsx | 45 ------------------- .../{release-note => release-notes}/index.md | 0 .../index.page.tsx | 2 +- 12 files changed, 18 insertions(+), 94 deletions(-) delete mode 100644 pages/format4/body.md delete mode 100644 pages/format4/index.md delete mode 100644 pages/format4/index.page.tsx rename pages/{release-note => release-notes}/index.md (100%) rename pages/{release-note => release-notes}/index.page.tsx (94%) diff --git a/components/DocTable.tsx b/components/DocTable.tsx index 906475b11..770a660ca 100644 --- a/components/DocTable.tsx +++ b/components/DocTable.tsx @@ -8,7 +8,7 @@ const DocTable = ({ frontmatter }: any) => {
Specification - {frontmatter.Specification} + + {' '} + {frontmatter.Specification} +
Published
Authors
Metaschema - {frontmatter.Metaschema} + + {frontmatter.Metaschema} +
Implementations - {frontmatter.Implementations} + + {frontmatter.Implementations} +
- - - - - - - -
+ Specification @@ -23,7 +23,7 @@ const DocTable = ({ frontmatter }: any) => {
+ Published @@ -31,7 +31,7 @@ const DocTable = ({ frontmatter }: any) => {
+ Authors @@ -41,7 +41,7 @@ const DocTable = ({ frontmatter }: any) => {
+ Metaschema @@ -54,20 +54,6 @@ const DocTable = ({ frontmatter }: any) => {
- Implementations - - - {frontmatter.Implementations} - -
diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 032eb08ba..36231f500 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -133,14 +133,15 @@ const getReferencePath = [ '/implementers/interfaces', ]; const getSpecificationPath = [ - '/draft/2020-12/release-notes', - '/draft/2019-09/release-notes', - '/draft-07/json-schema-release-notes', - '/draft-06/json-schema-release-notes', - '/draft-05/readme', - '/draft-07/json-hyper-schema-release-notes', - '/draft-06/json-hyper-schema-release-notes', + '/draft/2020-12/', + '/draft/2019-09/', + '/draft-07/', + '/draft-06/', + '/draft-05/', '/specification-links', + '/migration', + '/release-notes', + '/json-hyper-schema', '/specification', ]; diff --git a/pages/draft-05/index.md b/pages/draft-05/index.md index 0a13d69be..157693d0c 100644 --- a/pages/draft-05/index.md +++ b/pages/draft-05/index.md @@ -4,12 +4,10 @@ Published: '21-April-2017' type: docs authors: ['Austin Wright', 'Henry Andrews', 'Ben Hutton', 'Greg Dennis'] Metaschema: 'https://json-schema.org/draft/2020-12/schema' -Implementations: 'https://bowtie.report/#/dialects/draft2020-12' Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' -Status: 'Stable' --- -### Access all data connected to draft 05 +### Draft-05 Documents - Core: [draft-wright-json-schema-00](https://json-schema.org/draft-05/draft-wright-json-schema-00.pdf) ([changes](https://json-schema.org/draft-05/draft-wright-json-schema-00.pdf#appendix-B)) - Validation: [draft-wright-json-schema-validation-00](https://json-schema.org/draft-05/draft-wright-json-schema-validation-00.pdf) ([changes](https://json-schema.org/draft-05/draft-wright-json-schema-validation-00.pdf#appendix-B)) diff --git a/pages/draft-06/index.md b/pages/draft-06/index.md index 14f41a494..195a29c77 100644 --- a/pages/draft-06/index.md +++ b/pages/draft-06/index.md @@ -5,11 +5,9 @@ type: docs authors: ['Austin Wright', 'Henry Andrews', 'Ben Hutton', 'Greg Dennis'] Metaschema: 'https://json-schema.org/draft/2020-12/schema' Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' -Implementations: 'https://bowtie.report/#/dialects/draft2020-12' -Status: 'Stable' --- -### Access all data connected to draft-06 +### Draft-06 Documents - Validation: [draft-wright-json-schema-validation-01](https://json-scheclsma.org/draft-06/draft-wright-json-schema-validation-01.html) ([changes](https://json-schema.org/draft-06/draft-wright-json-schema-validation-01.html#rfc.appendix.B)) ([schema migration FAQ](https://json-schema.org/draft-06/json-schema-release-notes)) - Hyper-Schema: [draft-wright-json-schema-hyperschema-01](https://json-schema.org/draft-06/draft-wright-json-schema-hyperschema-01.html) ([changes](https://json-schema.org/draft-06/draft-wright-json-schema-hyperschema-01.html#rfc.appendix.B)) ([hyper-schema migration FAQ](https://json-schema.org/draft-06/json-hyper-schema-release-notes)) diff --git a/pages/draft-07/index.md b/pages/draft-07/index.md index a1c8a7fba..3638e39b0 100644 --- a/pages/draft-07/index.md +++ b/pages/draft-07/index.md @@ -5,15 +5,13 @@ type: docs authors: ['Austin Wright', 'Henry Andrews', 'Ben Hutton', 'Greg Dennis'] Metaschema: 'https://json-schema.org/draft/2020-12/schema' Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' -Implementations: 'https://bowtie.report/#/dialects/draft2020-12' -Status: 'Stable' --- ### Introduction The JSON Schema Draft-07 introduces various updates to enhance the functionality of JSON Schemas in contrast to maintaining backward compatibility with Draft-06. -### Access all data connected to draft 07 +### Draft-07 Documents - Core: [draft-handrews-json-schema-01](https://json-schema.org/draft-07/draft-handrews-json-schema-01.html) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-01.html#rfc.appendix.B)) - Validation: [draft-handrews-json-schema-validation-01](https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01.html) ([changes](https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01.html#rfc.appendix.B)) diff --git a/pages/draft/2019-09/index.md b/pages/draft/2019-09/index.md index 175b345dc..cd36d0576 100644 --- a/pages/draft/2019-09/index.md +++ b/pages/draft/2019-09/index.md @@ -9,8 +9,6 @@ authors: - Greg Dennis Published: 17-September-2019 Metaschema: https://json-schema.org/draft/2020-12/schema -Implementations: https://bowtie.report/#/dialects/draft2020-12 -Status: Stable --- ### Introduction @@ -19,7 +17,7 @@ The JSON Schema Draft 2019-09 introduces updates and changes to improve the reli One significant update is the shift to HTTPS for all meta-schema URIs. While the URIs remain accessible over HTTP due to certain limitations, the recommended standard is now firmly HTTPS. -### Access all data connected to draft 2019-09 +### Draft 2019-09 Documents **\*NOTE:** All meta-schema URIs now use `https://`. While currently also available over plain HTTP due to the limitations of GitHub pages and the need to keep prior drafts available over HTTP, only the HTTPS URIs should be used.\* diff --git a/pages/draft/2020-12/index.md b/pages/draft/2020-12/index.md index e802dbfa5..5be03ef7e 100644 --- a/pages/draft/2020-12/index.md +++ b/pages/draft/2020-12/index.md @@ -4,9 +4,7 @@ Published: '16 June 2022' type: docs authors: ['Austin Wright', 'Henry Andrews', 'Ben Hutton', 'Greg Dennis'] Metaschema: 'https://json-schema.org/draft/2020-12/schema' -Implementations: 'https://bowtie.report/#/dialects/draft2020-12' Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' -Status: 'Stable' --- ### Introduction @@ -23,7 +21,7 @@ Here's an overview of updates to Draft 2020-12; - **Embedded Schemas and Bundling**: Provides guidance on bundling schemas into a Compound Schema Document. - **Vocabulary Changes**: Separates the `format` vocabulary into `format-annotation` and `format-assertion`. -### Access all data connected to Draft 2020-12 +### Draft 2020-12 Documents - Specifications - Core: [draft-bhutton-json-schema-01](https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-01.html) ([changes](https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-01.html#appendix-G)) diff --git a/pages/format4/body.md b/pages/format4/body.md deleted file mode 100644 index 1006bd1a4..000000000 --- a/pages/format4/body.md +++ /dev/null @@ -1,2 +0,0 @@ - -### Hello from body.md \ No newline at end of file diff --git a/pages/format4/index.md b/pages/format4/index.md deleted file mode 100644 index adc1a34ad..000000000 --- a/pages/format4/index.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Title -type: Type ---- - -### Hello from index.md diff --git a/pages/format4/index.page.tsx b/pages/format4/index.page.tsx deleted file mode 100644 index fe800f5e1..000000000 --- a/pages/format4/index.page.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import React from 'react'; -import { getLayout } from '~/components/SiteLayout'; -import fs from 'fs'; -import matter from 'gray-matter'; -import StyledMarkdown from '~/components/StyledMarkdown'; -import { SectionContext } from '~/context'; - -export async function getStaticProps() { - const index = fs.readFileSync('pages/format4/index.md', 'utf-8'); - const main = fs.readFileSync('pages/format4/body.md', 'utf-8'); - const { content: indexContent, data: indexData } = matter(index); - const { content: bodyContent } = matter(main); - - const frontmatter = { ...indexData }; - return { - props: { - blocks: { - index: indexContent, - body: bodyContent, - }, - frontmatter, - }, - }; -} - -export default function ImplementationsPages({ - blocks, - frontmatter, -}: { - blocks: any; - frontmatter: any; -}) { - return ( - -
-

{frontmatter.title}

-

{frontmatter.type}

- - - -
-
- ); -} -ImplementationsPages.getLayout = getLayout; diff --git a/pages/release-note/index.md b/pages/release-notes/index.md similarity index 100% rename from pages/release-note/index.md rename to pages/release-notes/index.md diff --git a/pages/release-note/index.page.tsx b/pages/release-notes/index.page.tsx similarity index 94% rename from pages/release-note/index.page.tsx rename to pages/release-notes/index.page.tsx index f745f9325..e8f70f9d3 100644 --- a/pages/release-note/index.page.tsx +++ b/pages/release-notes/index.page.tsx @@ -6,7 +6,7 @@ import StyledMarkdown from '~/components/StyledMarkdown'; import { SectionContext } from '~/context'; export async function getStaticProps() { - const index = fs.readFileSync('pages/release-note/index.md', 'utf-8'); + const index = fs.readFileSync('pages/release-notes/index.md', 'utf-8'); // const main = fs.readFileSync('pages/draft-05/release-notes.md', 'utf-8'); const { content: indexContent, data: indexData } = matter(index); // const { content: bodyContent } = matter(main); From 1465e80f152f7bf74df075f0cbe9c19472165a01 Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe Date: Thu, 25 Jul 2024 14:45:34 +0100 Subject: [PATCH 18/35] Modified json hyper-schema page --- pages/json-hyper-schema/index.md | 27 ++++++++++++++++++++------ pages/json-hyper-schema/index.page.tsx | 3 ++- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/pages/json-hyper-schema/index.md b/pages/json-hyper-schema/index.md index 1be398eca..b5f92bddd 100644 --- a/pages/json-hyper-schema/index.md +++ b/pages/json-hyper-schema/index.md @@ -1,10 +1,25 @@ --- title: JSON Hyper-Schema -type: docs --- -- JSON Hyper-Schema - - There was no JSON Hyper-Schema draft for 2020-12 releases. - - [Draft-07 to 2019-09](https://json-schema.org/draft/2019-09#hyper-schema-vocabulary) - - [Draft-04 to Draft-07](https://json-schema.org/draft-07#json-hyper-schema-draft-07-release-notes) - - [Draft-04 to Draft-06](https://json-schema.org/draft-06#json-hyper-schema-draft-06-release-notes) +### Introduction + +JSON Hyper-Schema enables the definition of hyperlinks within JSON documents. It allows schemas to describe JSON data's structure and validation rules and provides information about navigating and interacting with the data. + +A typical use case of the hyper-schema is working with hypermedia APIs, where the JSON responses include links to other resources, much like HTML does with hyperlinks. + +### Hyper Schema Documents + +- Hyper-Schema: [jsonschema-hyperschema.xml](https://github.com/json-schema-org/json-hyperschema-spec/blob/main/jsonschema-hyperschema.xml) + + - Relative JSON Pointer: [relative-json-pointer.xml](https://github.com/json-schema-org/json-schema-spec/blob/master/relative-json-pointer.xml) + - [JSON Schema meta-schema](https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json) + - [JSON Hyper-Schema meta-schema](https://github.com/json-schema-org/json-hyperschema-spec/blob/main/hyper-schema.json) + - [JSON Hyper-Schema Link Description Object meta-schema](https://github.com/json-schema-org/json-hyperschema-spec/blob/main/links.json) + - [JSON Schema Vocabulary meta-schemas](https://github.com/json-schema-org/json-hyperschema-spec/tree/main/meta/) + - [JSON Schema Output schemas and examples](https://github.com/json-schema-org/json-hyperschema-spec/tree/main/output/) + +- There was no JSON Hyper-Schema draft for 2020-12 releases. +- [Draft-07 to 2019-09](https://json-schema.org/draft/2019-09#hyper-schema-vocabulary) +- [Draft-04 to Draft-07](https://json-schema.org/draft-07#json-hyper-schema-draft-07-release-notes) +- [Draft-04 to Draft-06](https://json-schema.org/draft-06#json-hyper-schema-draft-06-release-notes) diff --git a/pages/json-hyper-schema/index.page.tsx b/pages/json-hyper-schema/index.page.tsx index 51d632797..eb49d0c19 100644 --- a/pages/json-hyper-schema/index.page.tsx +++ b/pages/json-hyper-schema/index.page.tsx @@ -4,6 +4,7 @@ import fs from 'fs'; import matter from 'gray-matter'; import StyledMarkdown from '~/components/StyledMarkdown'; import { SectionContext } from '~/context'; +import { Headline1 } from '~/components/Headlines'; export async function getStaticProps() { const index = fs.readFileSync('pages/json-hyper-schema/index.md', 'utf-8'); @@ -33,7 +34,7 @@ export default function ImplementationsPages({ return (
-

{frontmatter.title}

+ {frontmatter.title}

{frontmatter.type}

{frontmatter.Specification}

From 82466c72e634680a44fae1363c395dfabe94ae1e Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe Date: Mon, 5 Aug 2024 19:45:44 +0100 Subject: [PATCH 19/35] Resolved feedbacks --- pages/draft-06/json-hyper-schema-release-notes.md | 12 +++++------- pages/draft-06/json-schema-release-notes.md | 14 +++++++------- pages/draft-07/json-hyper-schema-release-notes.md | 5 ++--- pages/json-hyper-schema/index.page.tsx | 2 +- styles/globals.css | 2 +- 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/pages/draft-06/json-hyper-schema-release-notes.md b/pages/draft-06/json-hyper-schema-release-notes.md index 53def600e..94ce73117 100644 --- a/pages/draft-06/json-hyper-schema-release-notes.md +++ b/pages/draft-06/json-hyper-schema-release-notes.md @@ -4,15 +4,15 @@ Release notes for migrating from draft-luff-json-hyper-schema-00 (draft-04) to d
NOTE: draft-07 has been released
-The [migration notes for draft-07](../draft-07/json-hyper-schema-release-notes) give a much more straightforward overview of migrating from draft-04 to draft-07 by skipping the complicated intermediate states of draft-05 and draft-06. This page has been retained for historical interest, but it is not recommened for those who just want to get going with the latest draft. +The [migration notes for draft-07](../draft-07/json-hyper-schema-release-notes) give a much more straightforward overview of migrating from draft-04 to draft-07 by skipping the complicated intermediate states of draft-05 and draft-06. This page has been retained for historical interest, but it is not recommened for those who only want to get going with the latest draft. -**For implementors:** We recommend just implementing draft-07, and not draft-06 or earlier. +**For implementors:** We recommend only implementing draft-07, and not draft-06 or earlier. - [Q: What are the incompatible changes between draft-04 and draft-06?](#q:-what-are-the-incompatible-changes-between-draft-04-and-draft-06) - [Changes from draft-04 to draft-05](#changes-from-draft-04-to-draft-05) - [Changes from draft-05 to draft-06](#changes-from-draft-05-to-draft-06) - [Proper use of "targetSchema"](#proper-use-of) -- [Q: Why were several major changes made to Hyper-Schema just before draft-06’s publication?](#q:-why-were-several-major-changes-made-to-hyper-schema-just-before-draft-06's-publication) +- [Q: Why were several major changes made to Hyper-Schema before draft-06’s publication?](#q:-why-were-several-major-changes-made-to-hyper-schema-just-before-draft-06's-publication) - [Q: Why doesn’t the spec mention or behave like HTML anymore?](#q:-why-doesn't-the-spec-mention-or-behave-like-html-anymore) - [Splitting "schema"](#splitting) - [Removing "method"](#removing) @@ -52,7 +52,7 @@ While we knew that there were still major gaps in draft-06, we felt that it was ##### Proper use of `"targetSchema"` -While `"targetSchema"` did not change its meaning in either recent draft, it has been widely misinterpreted. So it may feel like a change to use it as specified. +Although 'targetSchema' has kept its meaning, its interpretation has varied. Therefore, using it as intended might feel like a modification Due to draft-04 emphasizing individual HTTP methods as `"method"` values, many users interpreted `"targetSchema"` as a hint of the response to the method in `"method"`. This was never correct; all drafts define this keyword as describing the representation of the target resource, which appears as a response to HTTP GET, but may or may not appear in other responses. @@ -93,9 +93,7 @@ Several URI schemes and namespaces, such as the [UUID namespace in the `urn:` sc And of course, there are ways to detect this at runtime such as HTTP's `"Allow"` response header, or attempting a method and handling a `405 Method Not Allowed` error accordingly. -#### Q: No, really. How do I _explicitly_ indicate which HTTP methods are supported on a link? - -A: The [`"targetHints"` proposal](https://github.com/json-schema-org/json-schema-spec/issues/296) is part of draft-07, so using it as an extension to draft-06 is an option, but we recommend simply using draft-07 at this point. +If you need to explicitly indicate which HTTP methods are supported, you can use 'targetHints' from draft-07 as an extension to draft-06. #### Q: If `"targetSchema"` is not the response, how do I describe responses? diff --git a/pages/draft-06/json-schema-release-notes.md b/pages/draft-06/json-schema-release-notes.md index 6b1699128..6fe425e0b 100644 --- a/pages/draft-06/json-schema-release-notes.md +++ b/pages/draft-06/json-schema-release-notes.md @@ -31,15 +31,15 @@ For more information, see that draft's [migration notes](../../draft-07/json-sch | keyword | change | consequence | | --------------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | booleans as schemas | allowable anywhere, not just `"additionalProperties"` and `"additionalItems"` | `true` is equivalent to `{}`, `false` is equivalent to `{"not": {}}`, but the intent is more clear and implementations can optimize these cases more easily | -| `"propertyNames"` | added | takes a schema which validates the _names_ of all properties rather than their values | -| `"contains"` | added | array keyword that passes validation if its schema validates at least one array item | -| `"const"` | added | more readible form of a one-element `"enum"` | +| `"propertyNames"` | _added_ | takes a schema which validates the _names_ of all properties rather than their values | +| `"contains"` | _added_ | array keyword that passes validation if its schema validates at least one array item | +| `"const"` | _added_ | more readible form of a one-element `"enum"` | | `"required"` | allows an empty array | an empty array indicates that no properties are required | | `"dependencies"` | allows an empty array for property dependencies | an empty array indicates that there are no dependencies for the given property | -| `"format": "uri-reference"` | added | allows relative URI references per RFC 3986; see the section below about `"uri"` as a format | -| `"format": "uri-template"` | added | indicates an RFC 6570 conforming URI Template value, as is used in JSON Hyper-Schema for `"href"` | -| `"format": "json-pointer"` | added | indicates a JSON Pointer value such as `/foo/bar`; do _not_ use this for JSON Pointer URI fragments such as `#/foo/bar`: the proper format for those is `"uri-reference"` | -| `"examples"` | added | array of examples with no validation effect; the value of `"default"` is usable as an example without repeating it under this keyword | +| `"format": "uri-reference"` | _added_ | allows relative URI references per RFC 3986; see the section below about `"uri"` as a format | +| `"format": "uri-template"` | _added_ | indicates an RFC 6570 conforming URI Template value, as is used in JSON Hyper-Schema for `"href"` | +| `"format": "json-pointer"` | _added_ | indicates a JSON Pointer value such as `/foo/bar`; do _not_ use this for JSON Pointer URI fragments such as `#/foo/bar`: the proper format for those is `"uri-reference"` | +| `"examples"` | _added_ | array of examples with no validation effect; the value of `"default"` is usable as an example without repeating it under this keyword | ##### Formats: `"uri"` vs `"uri-reference"` diff --git a/pages/draft-07/json-hyper-schema-release-notes.md b/pages/draft-07/json-hyper-schema-release-notes.md index 3fb7aff68..fce0ec41e 100644 --- a/pages/draft-07/json-hyper-schema-release-notes.md +++ b/pages/draft-07/json-hyper-schema-release-notes.md @@ -9,11 +9,10 @@ so keywords used for other purposes (`readOnly` and `media`) have been The [new draft](../../draft-07/json-schema-hypermedia.html) has been completely rewritten for clarity and accessibility, so it is best to simply approach it as a new -proposal. We hope to add tutorial material at some point, but that is -outside of the scope of release notes. +proposal. However, if you wish to migrate from an earlier draft, this page is a guide -to the key _changes_. The additions, which are much more numerous, +to the key changes. The additions, which are much more numerous, should be learned directly from the new specification until we can provide tutorials. diff --git a/pages/json-hyper-schema/index.page.tsx b/pages/json-hyper-schema/index.page.tsx index eb49d0c19..f71fd5f51 100644 --- a/pages/json-hyper-schema/index.page.tsx +++ b/pages/json-hyper-schema/index.page.tsx @@ -34,7 +34,7 @@ export default function ImplementationsPages({ return (
- {frontmatter.title} + {frontmatter.title}

{frontmatter.type}

{frontmatter.Specification}

diff --git a/styles/globals.css b/styles/globals.css index a7e18d562..b028c23c3 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -269,4 +269,4 @@ border-radius: 4px; */ body { @apply dark:bg-slate-800 bg-white; } -} \ No newline at end of file +} From e87f7ccfaecfbbe856247b269496301cc82db897 Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe <60541622+kwennB@users.noreply.github.com> Date: Mon, 19 Aug 2024 11:59:37 +0100 Subject: [PATCH 20/35] Update pages/draft-06/json-schema-release-notes.md Co-authored-by: Benjamin Granados <40007659+benjagm@users.noreply.github.com> --- pages/draft-06/json-schema-release-notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/draft-06/json-schema-release-notes.md b/pages/draft-06/json-schema-release-notes.md index 6fe425e0b..f450c9aff 100644 --- a/pages/draft-06/json-schema-release-notes.md +++ b/pages/draft-06/json-schema-release-notes.md @@ -1,4 +1,4 @@ -### Draft-06 release note +### Draft-06 release notes Release notes for migrating from zyp-04 and fge-00 (draft-04) to wright-01 (draft-06). From c177a5031cf434c4177d57d57f347767b02fbb9c Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe <60541622+kwennB@users.noreply.github.com> Date: Mon, 19 Aug 2024 12:00:13 +0100 Subject: [PATCH 21/35] Update pages/draft/2019-09/release-notes.md Co-authored-by: Benjamin Granados <40007659+benjagm@users.noreply.github.com> --- pages/draft/2019-09/release-notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/draft/2019-09/release-notes.md b/pages/draft/2019-09/release-notes.md index 3285146c4..82b7d3948 100644 --- a/pages/draft/2019-09/release-notes.md +++ b/pages/draft/2019-09/release-notes.md @@ -1,4 +1,4 @@ -### Draft 2019-09 Release Note +### Draft 2019-09 Release Notes For the vast majority of schema authors, we hope that these changes are minimally disruptive. From aed87d767a70c4b8ff2b10e59d1a239f8ba18dd9 Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe <60541622+kwennB@users.noreply.github.com> Date: Mon, 19 Aug 2024 12:00:28 +0100 Subject: [PATCH 22/35] Update pages/draft-07/json-schema-release-notes.md Co-authored-by: Benjamin Granados <40007659+benjagm@users.noreply.github.com> --- pages/draft-07/json-schema-release-notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/draft-07/json-schema-release-notes.md b/pages/draft-07/json-schema-release-notes.md index 6c1f78eee..afa5f98b5 100644 --- a/pages/draft-07/json-schema-release-notes.md +++ b/pages/draft-07/json-schema-release-notes.md @@ -1,4 +1,4 @@ -### Draft-07 Release Note +### Draft-07 Release Notes For the Core and Validation specifications, draft-07 is a relatively minor update. In terms of validation keywords and outcomes, it is fully From 5775366692f433ddbeba89a9ea06b2d67c6b647e Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe <60541622+kwennB@users.noreply.github.com> Date: Mon, 19 Aug 2024 12:00:45 +0100 Subject: [PATCH 23/35] Update pages/migration/index.md Co-authored-by: Benjamin Granados <40007659+benjagm@users.noreply.github.com> --- pages/migration/index.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/migration/index.md b/pages/migration/index.md index d2f6a8686..779ebeb7d 100644 --- a/pages/migration/index.md +++ b/pages/migration/index.md @@ -1,4 +1,7 @@ -### Migrating from older drafts +--- +title: Migrating from older drafts +section: docs +--- The release notes discuss the changes impacting users and implementers: From bdca8df7556945d78fc23fdbd7968017a3f10fbc Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe <60541622+kwennB@users.noreply.github.com> Date: Mon, 19 Aug 2024 12:02:06 +0100 Subject: [PATCH 24/35] Update pages/draft-07/index.md Co-authored-by: Benjamin Granados <40007659+benjagm@users.noreply.github.com> --- pages/draft-07/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/draft-07/index.md b/pages/draft-07/index.md index 3638e39b0..069be3818 100644 --- a/pages/draft-07/index.md +++ b/pages/draft-07/index.md @@ -2,7 +2,7 @@ title: 'Draft-07' Published: '19-March-2018' type: docs -authors: ['Austin Wright', 'Henry Andrews', 'Ben Hutton', 'Greg Dennis'] +authors: ['Austin Wright', 'Henry Andrews'] Metaschema: 'https://json-schema.org/draft/2020-12/schema' Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' --- From 2ce491ea550ebcb374377125d083068aef6cef30 Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe <60541622+kwennB@users.noreply.github.com> Date: Mon, 19 Aug 2024 12:02:40 +0100 Subject: [PATCH 25/35] Update pages/migration/index.page.tsx Co-authored-by: Benjamin Granados <40007659+benjagm@users.noreply.github.com> --- pages/migration/index.page.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pages/migration/index.page.tsx b/pages/migration/index.page.tsx index d8926c521..4844b66e6 100644 --- a/pages/migration/index.page.tsx +++ b/pages/migration/index.page.tsx @@ -32,15 +32,11 @@ export default function ImplementationsPages({ }) { return ( -
-

{frontmatter.title}

-

{frontmatter.type}

-

{frontmatter.Specification}

- +
+ {frontmatter.title}
- ); } ImplementationsPages.getLayout = getLayout; From 48d999b53ea70436c3a1009820eca3501ea3ec55 Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe <60541622+kwennB@users.noreply.github.com> Date: Mon, 19 Aug 2024 12:06:00 +0100 Subject: [PATCH 26/35] Update components/Sidebar.tsx Co-authored-by: Benjamin Granados <40007659+benjagm@users.noreply.github.com> --- components/Sidebar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 36231f500..c27c2a429 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -680,7 +680,7 @@ export const DocsNav = ({ From 45d38c69bb33fe889eedcf802b2e2bd63d3a85de Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe <60541622+kwennB@users.noreply.github.com> Date: Mon, 19 Aug 2024 12:07:29 +0100 Subject: [PATCH 27/35] Update pages/release-notes/index.page.tsx Co-authored-by: Benjamin Granados <40007659+benjagm@users.noreply.github.com> --- pages/release-notes/index.page.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pages/release-notes/index.page.tsx b/pages/release-notes/index.page.tsx index e8f70f9d3..ce6612086 100644 --- a/pages/release-notes/index.page.tsx +++ b/pages/release-notes/index.page.tsx @@ -32,11 +32,8 @@ export default function ImplementationsPages({ }) { return ( -
-

{frontmatter.title}

-

{frontmatter.type}

-

{frontmatter.Specification}

- +
+ {frontmatter.title}
From cd1ea3a05789257d54256b7c56b15629c15d8c9c Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe <60541622+kwennB@users.noreply.github.com> Date: Mon, 19 Aug 2024 12:21:39 +0100 Subject: [PATCH 28/35] Update pages/release-notes/index.md Co-authored-by: Benjamin Granados <40007659+benjagm@users.noreply.github.com> --- pages/release-notes/index.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pages/release-notes/index.md b/pages/release-notes/index.md index d5db70362..8dfb9efe4 100644 --- a/pages/release-notes/index.md +++ b/pages/release-notes/index.md @@ -1,4 +1,9 @@ -### Release notes for all drafts +--- +title: Release notes +type: docs +--- + +Find below the Release Notes of all JSON Schema drafts: - [Draft 2020-12 release notes](draft/2020-12#draft-2020-12-release-notes) - [Draft 2019-09 release notes](draft/2019-09#draft-2019-09-release-note) From aed478c56f2673855a1c890694cb7fd6b26f96de Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe <60541622+kwennB@users.noreply.github.com> Date: Mon, 19 Aug 2024 12:24:18 +0100 Subject: [PATCH 29/35] Update pages/draft-06/index.md Co-authored-by: Benjamin Granados <40007659+benjagm@users.noreply.github.com> --- pages/draft-06/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/draft-06/index.md b/pages/draft-06/index.md index 195a29c77..32c55e6a4 100644 --- a/pages/draft-06/index.md +++ b/pages/draft-06/index.md @@ -2,7 +2,7 @@ title: 'Draft-06' Published: '21-April-2017' type: docs -authors: ['Austin Wright', 'Henry Andrews', 'Ben Hutton', 'Greg Dennis'] +authors: ['Austin Wright', 'Henry Andrews'] Metaschema: 'https://json-schema.org/draft/2020-12/schema' Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' --- From 783d1d0e622cc8a1251d5636160c3af46b4f8cd4 Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe <60541622+kwennB@users.noreply.github.com> Date: Mon, 19 Aug 2024 12:25:14 +0100 Subject: [PATCH 30/35] Update pages/draft-05/index.md Co-authored-by: Benjamin Granados <40007659+benjagm@users.noreply.github.com> --- pages/draft-05/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/draft-05/index.md b/pages/draft-05/index.md index 157693d0c..a44e46f81 100644 --- a/pages/draft-05/index.md +++ b/pages/draft-05/index.md @@ -2,7 +2,7 @@ title: 'Draft-05' Published: '21-April-2017' type: docs -authors: ['Austin Wright', 'Henry Andrews', 'Ben Hutton', 'Greg Dennis'] +authors: ['Austin Wright'] Metaschema: 'https://json-schema.org/draft/2020-12/schema' Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' --- From eee932a0523f6e2b4af649a28baf403ddcdc4268 Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe Date: Tue, 20 Aug 2024 16:14:30 +0100 Subject: [PATCH 31/35] modified meta-schema and specification links for all drafts --- pages/draft-05/index.md | 6 +++--- pages/draft-06/index.md | 4 ++-- pages/draft-07/index.md | 4 ++-- pages/draft/2019-09/index.md | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pages/draft-05/index.md b/pages/draft-05/index.md index a44e46f81..82e0c723d 100644 --- a/pages/draft-05/index.md +++ b/pages/draft-05/index.md @@ -1,10 +1,10 @@ --- title: 'Draft-05' -Published: '21-April-2017' +Published: '13-October-2016' type: docs authors: ['Austin Wright'] -Metaschema: 'https://json-schema.org/draft/2020-12/schema' -Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' +Metaschema: 'https://json-schema.org/draft-04/schema' +Specification: 'https://json-schema.org/draft-05/draft-wright-json-schema-00.pdf' --- ### Draft-05 Documents diff --git a/pages/draft-06/index.md b/pages/draft-06/index.md index 32c55e6a4..10e58837d 100644 --- a/pages/draft-06/index.md +++ b/pages/draft-06/index.md @@ -3,8 +3,8 @@ title: 'Draft-06' Published: '21-April-2017' type: docs authors: ['Austin Wright', 'Henry Andrews'] -Metaschema: 'https://json-schema.org/draft/2020-12/schema' -Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' +Metaschema: 'https://json-schema.org/draft-06/schema' +Specification: 'https://json-schema.org/draft-06/draft-wright-json-schema-01.html' --- ### Draft-06 Documents diff --git a/pages/draft-07/index.md b/pages/draft-07/index.md index 069be3818..4024bd8d2 100644 --- a/pages/draft-07/index.md +++ b/pages/draft-07/index.md @@ -3,8 +3,8 @@ title: 'Draft-07' Published: '19-March-2018' type: docs authors: ['Austin Wright', 'Henry Andrews'] -Metaschema: 'https://json-schema.org/draft/2020-12/schema' -Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html' +Metaschema: 'https://json-schema.org/draft-07/schema' +Specification: 'https://json-schema.org/draft-07/draft-handrews-json-schema-01.html' --- ### Introduction diff --git a/pages/draft/2019-09/index.md b/pages/draft/2019-09/index.md index cd36d0576..5158e0414 100644 --- a/pages/draft/2019-09/index.md +++ b/pages/draft/2019-09/index.md @@ -1,14 +1,14 @@ --- title: Draft 2019-09 section: docs -Specification: https://json-schema.org/draft/2020-12/json-schema-core.html +Specification: https://json-schema.org/draft/2019-09/draft-handrews-json-schema-02.html authors: - Austin Wright - Henry Andrews - Ben Hutton - Greg Dennis Published: 17-September-2019 -Metaschema: https://json-schema.org/draft/2020-12/schema +Metaschema: https://json-schema.org/draft/2019-09/schema --- ### Introduction From f6212d019923843f54077b0650870b7434a6f019 Mon Sep 17 00:00:00 2001 From: Benjamin Granados <40007659+benjagm@users.noreply.github.com> Date: Mon, 26 Aug 2024 11:22:25 +0200 Subject: [PATCH 32/35] Multiple changes --- components/Sidebar.tsx | 33 ++++--- pages/draft-05/index.page.tsx | 12 +-- pages/draft-06/index.page.tsx | 16 ++-- pages/draft-07/index.page.tsx | 16 ++-- pages/draft/2019-09/index.page.tsx | 12 +-- pages/draft/2020-12/index.page.tsx | 12 +-- pages/json-hyper-schema/index.md | 25 ------ pages/migration/index.md | 12 --- pages/migration/index.page.tsx | 42 --------- pages/release-notes/index.md | 12 --- pages/release-notes/index.page.tsx | 43 ---------- .../specification/json-hyper-schema/index.md | 27 ++++++ .../json-hyper-schema/index.page.tsx | 17 ++-- pages/specification/migration/index.page.tsx | 78 +++++++++++++++++ pages/specification/migration/intro.md | 7 ++ .../release-notes/index.page.tsx | 85 +++++++++++++++++++ pages/specification/release-notes/intro.md | 6 ++ 17 files changed, 265 insertions(+), 190 deletions(-) delete mode 100644 pages/json-hyper-schema/index.md delete mode 100644 pages/migration/index.md delete mode 100644 pages/migration/index.page.tsx delete mode 100644 pages/release-notes/index.md delete mode 100644 pages/release-notes/index.page.tsx create mode 100644 pages/specification/json-hyper-schema/index.md rename pages/{ => specification}/json-hyper-schema/index.page.tsx (71%) create mode 100644 pages/specification/migration/index.page.tsx create mode 100644 pages/specification/migration/intro.md create mode 100644 pages/specification/release-notes/index.page.tsx create mode 100644 pages/specification/release-notes/intro.md diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index c27c2a429..6bac75bc8 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -133,16 +133,17 @@ const getReferencePath = [ '/implementers/interfaces', ]; const getSpecificationPath = [ - '/draft/2020-12/', - '/draft/2019-09/', - '/draft-07/', - '/draft-06/', - '/draft-05/', + '/draft/2020-12', + '/draft/2019-09', + '/draft-07', + '/draft-06', + '/draft-05', '/specification-links', - '/migration', - '/release-notes', - '/json-hyper-schema', + '/specification/migration', + '/specification/release-notes', + '/specification/json-hyper-schema', '/specification', + '/specification-links', ]; export const SidebarLayout = ({ children }: { children: React.ReactNode }) => { @@ -667,9 +668,9 @@ export const DocsNav = ({ - - - + + +
- + diff --git a/pages/draft-05/index.page.tsx b/pages/draft-05/index.page.tsx index 4f22bc8a3..1d619e0b4 100644 --- a/pages/draft-05/index.page.tsx +++ b/pages/draft-05/index.page.tsx @@ -6,6 +6,7 @@ import StyledMarkdown from '~/components/StyledMarkdown'; import { SectionContext } from '~/context'; import DocTable from '~/components/DocTable'; import { Headline1 } from '~/components/Headlines'; +import { DocsHelp } from '~/components/DocsHelp'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft-05/index.md', 'utf-8'); @@ -34,12 +35,11 @@ export default function ImplementationsPages({ }) { return ( -
- {frontmatter.title} - - - -
+ {frontmatter.title} + + + +
); } diff --git a/pages/draft-06/index.page.tsx b/pages/draft-06/index.page.tsx index d146c61db..4e63230f1 100644 --- a/pages/draft-06/index.page.tsx +++ b/pages/draft-06/index.page.tsx @@ -6,6 +6,7 @@ import StyledMarkdown from '~/components/StyledMarkdown'; import { SectionContext } from '~/context'; import DocTable from '~/components/DocTable'; import { Headline1 } from '~/components/Headlines'; +import { DocsHelp } from '~/components/DocsHelp'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft-06/index.md', 'utf-8'); @@ -47,14 +48,13 @@ export default function ImplementationsPages({ }) { return ( -
- {frontmatter.title} - - - - - -
+ {frontmatter.title} + + + + + +
); } diff --git a/pages/draft-07/index.page.tsx b/pages/draft-07/index.page.tsx index d7d5ac112..8dd67863e 100644 --- a/pages/draft-07/index.page.tsx +++ b/pages/draft-07/index.page.tsx @@ -6,6 +6,7 @@ import StyledMarkdown from '~/components/StyledMarkdown'; import { SectionContext } from '~/context'; import DocTable from '~/components/DocTable'; import { Headline1 } from '~/components/Headlines'; +import { DocsHelp } from '~/components/DocsHelp'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft-07/index.md', 'utf-8'); @@ -47,14 +48,13 @@ export default function ImplementationsPages({ }) { return ( -
- {frontmatter.title} - - - - - -
+ {frontmatter.title} + + + + + +
); } diff --git a/pages/draft/2019-09/index.page.tsx b/pages/draft/2019-09/index.page.tsx index 4d5808c21..20a512ec0 100644 --- a/pages/draft/2019-09/index.page.tsx +++ b/pages/draft/2019-09/index.page.tsx @@ -6,6 +6,7 @@ import StyledMarkdown from '~/components/StyledMarkdown'; import { SectionContext } from '~/context'; import DocTable from '~/components/DocTable'; import { Headline1 } from '~/components/Headlines'; +import { DocsHelp } from '~/components/DocsHelp'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft/2019-09/index.md', 'utf-8'); @@ -34,12 +35,11 @@ export default function ImplementationsPages({ }) { return ( -
- {frontmatter.title} - - - -
+ {frontmatter.title} + + + +
); } diff --git a/pages/draft/2020-12/index.page.tsx b/pages/draft/2020-12/index.page.tsx index 635bbfe08..90892f938 100644 --- a/pages/draft/2020-12/index.page.tsx +++ b/pages/draft/2020-12/index.page.tsx @@ -6,6 +6,7 @@ import StyledMarkdown from '~/components/StyledMarkdown'; import { SectionContext } from '~/context'; import DocTable from '~/components/DocTable'; import { Headline1 } from '~/components/Headlines'; +import { DocsHelp } from '~/components/DocsHelp'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft/2020-12/index.md', 'utf-8'); @@ -34,12 +35,11 @@ export default function ImplementationsPages({ }) { return ( -
- {frontmatter.title} - - - -
+ {frontmatter.title} + + + +
); } diff --git a/pages/json-hyper-schema/index.md b/pages/json-hyper-schema/index.md deleted file mode 100644 index b5f92bddd..000000000 --- a/pages/json-hyper-schema/index.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: JSON Hyper-Schema ---- - -### Introduction - -JSON Hyper-Schema enables the definition of hyperlinks within JSON documents. It allows schemas to describe JSON data's structure and validation rules and provides information about navigating and interacting with the data. - -A typical use case of the hyper-schema is working with hypermedia APIs, where the JSON responses include links to other resources, much like HTML does with hyperlinks. - -### Hyper Schema Documents - -- Hyper-Schema: [jsonschema-hyperschema.xml](https://github.com/json-schema-org/json-hyperschema-spec/blob/main/jsonschema-hyperschema.xml) - - - Relative JSON Pointer: [relative-json-pointer.xml](https://github.com/json-schema-org/json-schema-spec/blob/master/relative-json-pointer.xml) - - [JSON Schema meta-schema](https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json) - - [JSON Hyper-Schema meta-schema](https://github.com/json-schema-org/json-hyperschema-spec/blob/main/hyper-schema.json) - - [JSON Hyper-Schema Link Description Object meta-schema](https://github.com/json-schema-org/json-hyperschema-spec/blob/main/links.json) - - [JSON Schema Vocabulary meta-schemas](https://github.com/json-schema-org/json-hyperschema-spec/tree/main/meta/) - - [JSON Schema Output schemas and examples](https://github.com/json-schema-org/json-hyperschema-spec/tree/main/output/) - -- There was no JSON Hyper-Schema draft for 2020-12 releases. -- [Draft-07 to 2019-09](https://json-schema.org/draft/2019-09#hyper-schema-vocabulary) -- [Draft-04 to Draft-07](https://json-schema.org/draft-07#json-hyper-schema-draft-07-release-notes) -- [Draft-04 to Draft-06](https://json-schema.org/draft-06#json-hyper-schema-draft-06-release-notes) diff --git a/pages/migration/index.md b/pages/migration/index.md deleted file mode 100644 index 779ebeb7d..000000000 --- a/pages/migration/index.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Migrating from older drafts -section: docs ---- - -The release notes discuss the changes impacting users and implementers: - -- JSON Schema Core and Validation - - [Draft 2019-09 to Draft 2020-12](draft/2020-12#draft-2020-12-release-notes) - - [Draft-07 to Draft 2019-09](draft/2019-09#draft-2019-09-release-note) - - [Draft-06 to Draft-07](draft-07#draft-07-release-note) - - [Draft-04 to Draft-06](draft-06#draft-06-release-note) diff --git a/pages/migration/index.page.tsx b/pages/migration/index.page.tsx deleted file mode 100644 index 4844b66e6..000000000 --- a/pages/migration/index.page.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react'; -import { getLayout } from '~/components/Sidebar'; -import fs from 'fs'; -import matter from 'gray-matter'; -import StyledMarkdown from '~/components/StyledMarkdown'; -import { SectionContext } from '~/context'; - -export async function getStaticProps() { - const index = fs.readFileSync('pages/migration/index.md', 'utf-8'); - // const main = fs.readFileSync('pages/draft-05/release-notes.md', 'utf-8'); - const { content: indexContent, data: indexData } = matter(index); - // const { content: bodyContent } = matter(main); - - const frontmatter = { ...indexData }; - return { - props: { - blocks: { - index: indexContent, - // body: bodyContent, - }, - frontmatter, - }, - }; -} - -export default function ImplementationsPages({ - blocks, - frontmatter, -}: { - blocks: any; - frontmatter: any; -}) { - return ( - -
- {frontmatter.title} - - -
- ); -} -ImplementationsPages.getLayout = getLayout; diff --git a/pages/release-notes/index.md b/pages/release-notes/index.md deleted file mode 100644 index 8dfb9efe4..000000000 --- a/pages/release-notes/index.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Release notes -type: docs ---- - -Find below the Release Notes of all JSON Schema drafts: - -- [Draft 2020-12 release notes](draft/2020-12#draft-2020-12-release-notes) -- [Draft 2019-09 release notes](draft/2019-09#draft-2019-09-release-note) -- [Draft-07 release notes](draft-07#draft-07-release-note) -- [Draft-06 release notes](draft-06#draft-06-release-note) -- [Draft-05 release notes](draft-05#explanation-for-lack-of-draft-05-meta-schemas) diff --git a/pages/release-notes/index.page.tsx b/pages/release-notes/index.page.tsx deleted file mode 100644 index ce6612086..000000000 --- a/pages/release-notes/index.page.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import React from 'react'; -import { getLayout } from '~/components/Sidebar'; -import fs from 'fs'; -import matter from 'gray-matter'; -import StyledMarkdown from '~/components/StyledMarkdown'; -import { SectionContext } from '~/context'; - -export async function getStaticProps() { - const index = fs.readFileSync('pages/release-notes/index.md', 'utf-8'); - // const main = fs.readFileSync('pages/draft-05/release-notes.md', 'utf-8'); - const { content: indexContent, data: indexData } = matter(index); - // const { content: bodyContent } = matter(main); - - const frontmatter = { ...indexData }; - return { - props: { - blocks: { - index: indexContent, - // body: bodyContent, - }, - frontmatter, - }, - }; -} - -export default function ImplementationsPages({ - blocks, - frontmatter, -}: { - blocks: any; - frontmatter: any; -}) { - return ( - -
- {frontmatter.title} - - -
-
- ); -} -ImplementationsPages.getLayout = getLayout; diff --git a/pages/specification/json-hyper-schema/index.md b/pages/specification/json-hyper-schema/index.md new file mode 100644 index 000000000..410d627b2 --- /dev/null +++ b/pages/specification/json-hyper-schema/index.md @@ -0,0 +1,27 @@ +--- +title: JSON Hyper-Schema +--- + +### Introduction + +JSON Hyper-Schema enables the definition of hyperlinks within JSON documents. It allows schemas to describe JSON data's structure and validation rules and provides information about navigating and interacting with the data. + +A typical use case of the hyper-schema is working with hypermedia APIs, where the JSON responses include links to other resources, much like HTML does with hyperlinks. + +### Hyper Schema Documents + +- Hyper-Schema: [jsonschema-hyperschema.xml](https://github.com/json-schema-org/json-hyperschema-spec/blob/main/jsonschema-hyperschema.xml) +- Relative JSON Pointer: [relative-json-pointer.xml](https://github.com/json-schema-org/json-schema-spec/blob/master/relative-json-pointer.xml) + +**Other documents:** +- [JSON Schema meta-schema](https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json) +- [JSON Hyper-Schema meta-schema](https://github.com/json-schema-org/json-hyperschema-spec/blob/main/hyper-schema.json) +- [JSON Hyper-Schema Link Description Object meta-schema](https://github.com/json-schema-org/json-hyperschema-spec/blob/main/links.json) +- [JSON Schema Vocabulary meta-schemas](https://github.com/json-schema-org/json-hyperschema-spec/tree/main/meta/) +- [JSON Schema Output schemas and examples](https://github.com/json-schema-org/json-hyperschema-spec/tree/main/output/) + +### Release Notes + +- [Draft-07 to 2019-09](https://json-schema.org/draft/2019-09#hyper-schema-vocabulary) +- [Draft-04 to Draft-07](https://json-schema.org/draft-07/json-hyper-schema-release-notes) +- [Draft-04 to Draft-06](https://json-schema.org/draft-06/json-hyper-schema-release-notes) diff --git a/pages/json-hyper-schema/index.page.tsx b/pages/specification/json-hyper-schema/index.page.tsx similarity index 71% rename from pages/json-hyper-schema/index.page.tsx rename to pages/specification/json-hyper-schema/index.page.tsx index f71fd5f51..bcf365031 100644 --- a/pages/json-hyper-schema/index.page.tsx +++ b/pages/specification/json-hyper-schema/index.page.tsx @@ -7,7 +7,10 @@ import { SectionContext } from '~/context'; import { Headline1 } from '~/components/Headlines'; export async function getStaticProps() { - const index = fs.readFileSync('pages/json-hyper-schema/index.md', 'utf-8'); + const index = fs.readFileSync( + 'pages/specification/json-hyper-schema/index.md', + 'utf-8', + ); // const main = fs.readFileSync('pages/draft-05/release-notes.md', 'utf-8'); const { content: indexContent, data: indexData } = matter(index); // const { content: bodyContent } = matter(main); @@ -33,14 +36,12 @@ export default function ImplementationsPages({ }) { return ( -
- {frontmatter.title} -

{frontmatter.type}

-

{frontmatter.Specification}

+ {frontmatter.title} +

{frontmatter.type}

+

{frontmatter.Specification}

- - -
+ +
); } diff --git a/pages/specification/migration/index.page.tsx b/pages/specification/migration/index.page.tsx new file mode 100644 index 000000000..f057ada5f --- /dev/null +++ b/pages/specification/migration/index.page.tsx @@ -0,0 +1,78 @@ +import React from 'react'; +import { getLayout } from '~/components/Sidebar'; +import fs from 'fs'; +import matter from 'gray-matter'; +import StyledMarkdown from '~/components/StyledMarkdown'; +import { Headline1 } from '~/components/Headlines'; +import { SectionContext } from '~/context'; +import Card from '~/components/Card'; +import { DocsHelp } from '~/components/DocsHelp'; + +export async function getStaticProps() { + const index = fs.readFileSync( + 'pages/specification/migration/intro.md', + 'utf-8', + ); + // const main = fs.readFileSync('pages/draft-05/release-notes.md', 'utf-8'); + const { content: indexContent, data: indexData } = matter(index); + // const { content: bodyContent } = matter(main); + + const frontmatter = { ...indexData }; + return { + props: { + blocks: { + index: indexContent, + // body: bodyContent, + }, + frontmatter, + }, + }; +} + +export default function ImplementationsPages({ + blocks, + frontmatter, +}: { + blocks: any; + frontmatter: any; +}) { + return ( + + {frontmatter.title} + + +
+ + + + +
+ +
+ ); +} +ImplementationsPages.getLayout = getLayout; diff --git a/pages/specification/migration/intro.md b/pages/specification/migration/intro.md new file mode 100644 index 000000000..734bd0b33 --- /dev/null +++ b/pages/specification/migration/intro.md @@ -0,0 +1,7 @@ +--- +title: Migrating from older drafts +section: docs +--- + +The release notes discuss the changes impacting users and implementers: + diff --git a/pages/specification/release-notes/index.page.tsx b/pages/specification/release-notes/index.page.tsx new file mode 100644 index 000000000..f5ef9359d --- /dev/null +++ b/pages/specification/release-notes/index.page.tsx @@ -0,0 +1,85 @@ +import React from 'react'; +import { getLayout } from '~/components/Sidebar'; +import fs from 'fs'; +import matter from 'gray-matter'; +import StyledMarkdown from '~/components/StyledMarkdown'; +import { Headline1 } from '~/components/Headlines'; +import { SectionContext } from '~/context'; +import Card from '~/components/Card'; +import { DocsHelp } from '~/components/DocsHelp'; + +export async function getStaticProps() { + const index = fs.readFileSync( + 'pages/specification/release-notes/intro.md', + 'utf-8', + ); + // const main = fs.readFileSync('pages/draft-05/release-notes.md', 'utf-8'); + const { content: indexContent, data: indexData } = matter(index); + // const { content: bodyContent } = matter(main); + + const frontmatter = { ...indexData }; + return { + props: { + blocks: { + index: indexContent, + // body: bodyContent, + }, + frontmatter, + }, + }; +} + +export default function ImplementationsPages({ + blocks, + frontmatter, +}: { + blocks: any; + frontmatter: any; +}) { + return ( + + {frontmatter.title} + + +
+ + + + + +
+ +
+ ); +} +ImplementationsPages.getLayout = getLayout; diff --git a/pages/specification/release-notes/intro.md b/pages/specification/release-notes/intro.md new file mode 100644 index 000000000..bfe2815c1 --- /dev/null +++ b/pages/specification/release-notes/intro.md @@ -0,0 +1,6 @@ +--- +title: Release notes +type: docs +--- + +Find below the Release Notes of all JSON Schema drafts: From 2b9cb35610479d4668823a763052b26cdec1afdc Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe Date: Mon, 26 Aug 2024 22:21:50 +0100 Subject: [PATCH 33/35] Updated JSON Hyperschema introductory text --- pages/specification/json-hyper-schema/index.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pages/specification/json-hyper-schema/index.md b/pages/specification/json-hyper-schema/index.md index 410d627b2..5515c03f9 100644 --- a/pages/specification/json-hyper-schema/index.md +++ b/pages/specification/json-hyper-schema/index.md @@ -4,9 +4,14 @@ title: JSON Hyper-Schema ### Introduction -JSON Hyper-Schema enables the definition of hyperlinks within JSON documents. It allows schemas to describe JSON data's structure and validation rules and provides information about navigating and interacting with the data. +JSON Hyper-Schema is an extension of JSON Schema that allows for the definition of hypermedia-driven APIs. The hyper-schema vocabulary shows how to annotate JSON documents with hypermedia controls by enabling the description of links and actions that can be executed on JSON data. Consecutively, it helps provide a more interactive and dynamic representation of JSON data. It also enhances API discoverability using the description features of actions and links within the JSON documents. -A typical use case of the hyper-schema is working with hypermedia APIs, where the JSON responses include links to other resources, much like HTML does with hyperlinks. +JSON Hyper-Schema seamlessly integrates with existing JSON HTTP APIs and offers functionalities to describe complex resource relationships, facilitate client-side validation, and promote better interaction patterns. It makes APIs more intuitive, self-descriptive, and efficient, particularly in RESTful architectures. + +In essence: + +- JSON Hyper-Schema is helpful in complex APIs where clients need to define and explicitly understand the relationships between resources and actions, especially when navigating resources without prior knowledge of the API structure. +- It helps create more discoverable and self-documenting APIs, making it easier for clients to interact with them. ### Hyper Schema Documents @@ -14,6 +19,7 @@ A typical use case of the hyper-schema is working with hypermedia APIs, where th - Relative JSON Pointer: [relative-json-pointer.xml](https://github.com/json-schema-org/json-schema-spec/blob/master/relative-json-pointer.xml) **Other documents:** + - [JSON Schema meta-schema](https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json) - [JSON Hyper-Schema meta-schema](https://github.com/json-schema-org/json-hyperschema-spec/blob/main/hyper-schema.json) - [JSON Hyper-Schema Link Description Object meta-schema](https://github.com/json-schema-org/json-hyperschema-spec/blob/main/links.json) From 9b6779b86cf286f9a33f288a06e9eab4e851caa3 Mon Sep 17 00:00:00 2001 From: Blessing Ene Anyebe Date: Fri, 13 Sep 2024 09:37:02 +0100 Subject: [PATCH 34/35] updated URL redirects --- public/_redirects | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/_redirects b/public/_redirects index 6282f8c5a..6d207ce39 100644 --- a/public/_redirects +++ b/public/_redirects @@ -23,3 +23,9 @@ /slack https://join.slack.com/t/json-schema/shared_invite/zt-2n5bzzgx3-ro3V0mnnzUoaguILLosT2A 301 /slack-redirect https://join.slack.com/t/json-schema/shared_invite/zt-2n5bzzgx3-ro3V0mnnzUoaguILLosT2A 301 /ambassadors https://github.com/json-schema-org/community/tree/main/programs/ambassadors 301 +/draft-2020-12-release-notes https://json-schema.org/draft/2020-12#draft-2020-12-release-notes 301 +/draft-2019-09-release-notes https://json-schema.org/draft/2019-09#draft-2019-09-release-notes 301 +/draft-07-release-notes https://json-schema.org/draft-07#draft-07-release-notes 301 +/draft-06-release-notes https://json-schema.org/draft-06#draft-06-release-notes 301 +/explanation-for-lack-of-draft-05-meta-schema https://json-schema.org/draft-05#explanation-for-lack-of-draft-05-meta-schema 301 +/migration https://json-schema.org/specification/migration 301 From 4954a25da313f61201c8bfb2d9020ca543aa0491 Mon Sep 17 00:00:00 2001 From: Benjamin Granados <40007659+benjagm@users.noreply.github.com> Date: Thu, 19 Sep 2024 08:00:19 +0200 Subject: [PATCH 35/35] Fix date formats, redirects and broken links --- pages/draft-05/index.md | 2 +- pages/draft-06/index.md | 2 +- pages/draft-07/index.md | 2 +- pages/draft/2019-09/index.md | 2 +- pages/specification/json-hyper-schema/index.md | 6 +++--- public/_redirects | 11 +++++------ 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/pages/draft-05/index.md b/pages/draft-05/index.md index 82e0c723d..91c72c2b0 100644 --- a/pages/draft-05/index.md +++ b/pages/draft-05/index.md @@ -1,6 +1,6 @@ --- title: 'Draft-05' -Published: '13-October-2016' +Published: '13 October 2016' type: docs authors: ['Austin Wright'] Metaschema: 'https://json-schema.org/draft-04/schema' diff --git a/pages/draft-06/index.md b/pages/draft-06/index.md index 10e58837d..7532b5637 100644 --- a/pages/draft-06/index.md +++ b/pages/draft-06/index.md @@ -1,6 +1,6 @@ --- title: 'Draft-06' -Published: '21-April-2017' +Published: '21 April 2017' type: docs authors: ['Austin Wright', 'Henry Andrews'] Metaschema: 'https://json-schema.org/draft-06/schema' diff --git a/pages/draft-07/index.md b/pages/draft-07/index.md index 4024bd8d2..a0cb39366 100644 --- a/pages/draft-07/index.md +++ b/pages/draft-07/index.md @@ -1,6 +1,6 @@ --- title: 'Draft-07' -Published: '19-March-2018' +Published: '19 March 2018' type: docs authors: ['Austin Wright', 'Henry Andrews'] Metaschema: 'https://json-schema.org/draft-07/schema' diff --git a/pages/draft/2019-09/index.md b/pages/draft/2019-09/index.md index 5158e0414..35921345a 100644 --- a/pages/draft/2019-09/index.md +++ b/pages/draft/2019-09/index.md @@ -7,7 +7,7 @@ authors: - Henry Andrews - Ben Hutton - Greg Dennis -Published: 17-September-2019 +Published: 17 September 2019 Metaschema: https://json-schema.org/draft/2019-09/schema --- diff --git a/pages/specification/json-hyper-schema/index.md b/pages/specification/json-hyper-schema/index.md index 5515c03f9..b116253a7 100644 --- a/pages/specification/json-hyper-schema/index.md +++ b/pages/specification/json-hyper-schema/index.md @@ -28,6 +28,6 @@ In essence: ### Release Notes -- [Draft-07 to 2019-09](https://json-schema.org/draft/2019-09#hyper-schema-vocabulary) -- [Draft-04 to Draft-07](https://json-schema.org/draft-07/json-hyper-schema-release-notes) -- [Draft-04 to Draft-06](https://json-schema.org/draft-06/json-hyper-schema-release-notes) +- [Draft-07 to 2019-09](../draft/2019-09#hyper-schema-vocabulary) +- [Draft-04 to Draft-07](../draft-07#json-hyper-schema-draft-07-release-notes) +- [Draft-04 to Draft-06](../draft-06#json-hyper-schema-draft-06-release-notes) diff --git a/public/_redirects b/public/_redirects index 6d207ce39..5cb005d33 100644 --- a/public/_redirects +++ b/public/_redirects @@ -23,9 +23,8 @@ /slack https://join.slack.com/t/json-schema/shared_invite/zt-2n5bzzgx3-ro3V0mnnzUoaguILLosT2A 301 /slack-redirect https://join.slack.com/t/json-schema/shared_invite/zt-2n5bzzgx3-ro3V0mnnzUoaguILLosT2A 301 /ambassadors https://github.com/json-schema-org/community/tree/main/programs/ambassadors 301 -/draft-2020-12-release-notes https://json-schema.org/draft/2020-12#draft-2020-12-release-notes 301 -/draft-2019-09-release-notes https://json-schema.org/draft/2019-09#draft-2019-09-release-notes 301 -/draft-07-release-notes https://json-schema.org/draft-07#draft-07-release-notes 301 -/draft-06-release-notes https://json-schema.org/draft-06#draft-06-release-notes 301 -/explanation-for-lack-of-draft-05-meta-schema https://json-schema.org/draft-05#explanation-for-lack-of-draft-05-meta-schema 301 -/migration https://json-schema.org/specification/migration 301 +/draft/2020-12/release-notes /draft/2020-12#draft-2020-12-release-notes 301 +/draft/2019-09/release-notes /draft/2019-09#draft-2019-09-release-notes 301 +/draft-07/json-schema-release-notes /draft-07#draft-07-release-notes 301 +/draft-06/json-schema-release-notes /draft-06#draft-06-release-notes 301 +/draft-05/readme /draft-05#explanation-for-lack-of-draft-05-meta-schemas 301