Skip to content

[bug] - Revert release notes changes #1010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions pages/draft-06/[slug].page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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 (
<SectionContext.Provider value={frontmatter.section || null}>
<Head>
<title>{newTitle}</title>
</Head>
<Headline1>{frontmatter.title}</Headline1>
<StyledMarkdown markdown={content} />
<DocsHelp markdownFile={markdownFile} />
</SectionContext.Provider>
);
}
StaticMarkdownPage.getLayout = getLayout;
5 changes: 5 additions & 0 deletions pages/draft-06/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ Specification: 'https://json-schema.org/draft-06/draft-wright-json-schema-01.htm
- 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)

### Release Notes

- [JSON Schema Release Notes](../draft-06/json-schema-release-notes)
- [JSON Hyper-Schema Release Notes](../draft-06/json-hyper-schema-release-notes)
18 changes: 0 additions & 18 deletions pages/draft-06/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,14 @@ import { DocsHelp } from '~/components/DocsHelp';

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 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 {
props: {
blocks: {
index: indexContent,
body: bodyContent,
hyperSchema: hyperSchemaContent,
readme: readmeContent,
},
frontmatter,
},
Expand All @@ -51,9 +36,6 @@ export default function ImplementationsPages({
<Headline1>{frontmatter.title}</Headline1>
<DocTable frontmatter={frontmatter} />
<StyledMarkdown markdown={blocks.index} />
<StyledMarkdown markdown={blocks.body} />
<StyledMarkdown markdown={blocks.hyperSchema} />
<StyledMarkdown markdown={blocks.readme} />
<DocsHelp />
</SectionContext.Provider>
);
Expand Down
115 changes: 60 additions & 55 deletions pages/draft-06/json-hyper-schema-release-notes.md

Large diffs are not rendered by default.

169 changes: 89 additions & 80 deletions pages/draft-06/json-schema-release-notes.md

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions pages/draft-06/readme.md

This file was deleted.

39 changes: 39 additions & 0 deletions pages/draft-07/[slug].page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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 (
<SectionContext.Provider value={frontmatter.section || null}>
<Head>
<title>{newTitle}</title>
</Head>
<Headline1>{frontmatter.title}</Headline1>
<StyledMarkdown markdown={content} />
<DocsHelp markdownFile={markdownFile} />
</SectionContext.Provider>
);
}
StaticMarkdownPage.getLayout = getLayout;
8 changes: 8 additions & 0 deletions pages/draft-07/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,11 @@ _These were updated without changing functionality or meta-schemas due to a few
- 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))

### 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.
18 changes: 0 additions & 18 deletions pages/draft-07/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,14 @@ import { DocsHelp } from '~/components/DocsHelp';

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 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 {
props: {
blocks: {
index: indexContent,
body: bodyContent,
hyperSchema: hyperSchemaContent,
readme: readmeContent,
},
frontmatter,
},
Expand All @@ -51,9 +36,6 @@ export default function ImplementationsPages({
<Headline1>{frontmatter.title}</Headline1>
<DocTable frontmatter={frontmatter} />
<StyledMarkdown markdown={blocks.index} />
<StyledMarkdown markdown={blocks.body} />
<StyledMarkdown markdown={blocks.hyperSchema} />
<StyledMarkdown markdown={blocks.readme} />
<DocsHelp />
</SectionContext.Provider>
);
Expand Down
92 changes: 48 additions & 44 deletions pages/draft-07/json-hyper-schema-release-notes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
### JSON Hyper-Schema Draft-07 Release Notes
---
title: JSON Hyper-Schema Draft-07 Release Notes
section: docs
---

JSON Hyper-Schema [draft-07](../../draft-07/json-schema-hypermedia.html) completes the
reworking of Hyper-Schema that was begun in draft-06.
Expand All @@ -9,55 +12,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.
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
Expand All @@ -75,53 +79,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": "..."}`
Loading