diff --git a/components/StyledMarkdown.tsx b/components/StyledMarkdown.tsx index 8dc83f573..6bed564b3 100644 --- a/components/StyledMarkdown.tsx +++ b/components/StyledMarkdown.tsx @@ -234,7 +234,9 @@ const StyledMarkdownBlock = ({ markdown }: { markdown: string }) => { }, table: { component: ({ children }) => ( - {children}
+
+ {children}
+
), }, thead: { diff --git a/pages/draft/2020-12/release-notes.md b/pages/draft/2020-12/release-notes.md index 5c2a783c1..cd04ba966 100644 --- a/pages/draft/2020-12/release-notes.md +++ b/pages/draft/2020-12/release-notes.md @@ -33,96 +33,102 @@ Here are some examples to illustrate the changes. ### Open tuple - - - - - - - - + + + + + + + + + +
Draft 2019-09Draft 2020-12
- ```json - { - "items": [ - { "$ref": "#/$defs/foo" }, - { "$ref": "#/$defs/bar" } - ] - } - ``` - - ```json - { - "prefixItems": [ - { "$ref": "#/$defs/foo" }, - { "$ref": "#/$defs/bar" } - ] - } - ``` -
Draft 2019-09Draft 2020-12
+ ```json + { + "items": [ + { "$ref": "#/$defs/foo" }, + { "$ref": "#/$defs/bar" } + ] + } + ``` + + ```json + { + "prefixItems": [ + { "$ref": "#/$defs/foo" }, + { "$ref": "#/$defs/bar" } + ] + } + ``` +
### Closed tuple - - - - - - - - + + + + + + + + + +
Draft 2019-09Draft 2020-12
- ```json - { - "items": [ - { "$ref": "#/$defs/foo" }, - { "$ref": "#/$defs/bar" } - ], - "additionalItems": false - } - ``` - - ```json - { - "prefixItems": [ - { "$ref": "#/$defs/foo" }, - { "$ref": "#/$defs/bar" } - ], - "items": false - } - ``` -
Draft 2019-09Draft 2020-12
+ ```json + { + "items": [ + { "$ref": "#/$defs/foo" }, + { "$ref": "#/$defs/bar" } + ], + "additionalItems": false + } + ``` + + ```json + { + "prefixItems": [ + { "$ref": "#/$defs/foo" }, + { "$ref": "#/$defs/bar" } + ], + "items": false + } + ``` +
### Tuple with constrained additional items - - - - - - - - + + + + + + + + + +
Draft 2019-09Draft 2020-12
- ```json - { - "items": [ - { "$ref": "#/$defs/foo" }, - { "$ref": "#/$defs/bar" } - ], - "additionalItems": { "$ref": "#/$defs/baz" } - } - ``` - - ```json - { - "prefixItems": [ - { "$ref": "#/$defs/foo" }, - { "$ref": "#/$defs/bar" } - ], - "items": { "$ref": "#/$defs/baz" } - } - ``` -
Draft 2019-09Draft 2020-12
+ ```json + { + "items": [ + { "$ref": "#/$defs/foo" }, + { "$ref": "#/$defs/bar" } + ], + "additionalItems": { "$ref": "#/$defs/baz" } + } + ``` + + ```json + { + "prefixItems": [ + { "$ref": "#/$defs/foo" }, + { "$ref": "#/$defs/bar" } + ], + "items": { "$ref": "#/$defs/baz" } + } + ``` +
## $dynamicRef and $dynamicAnchor @@ -149,6 +155,7 @@ used as the starting point for dynamic resolution. Here's how you would covert a schema using `$recursiveRef` to use `$dynamicRef`. + @@ -209,6 +216,7 @@ Here's how you would covert a schema using `$recursiveRef` to use `$dynamicRef`. ``` +
Draft 2019-09 Draft 2020-12
@@ -224,35 +232,37 @@ that has some item matching one schema and everything else matching another schema. - - - - - - + + + + + + - - + ``` + + + +
Draft 2019-09Draft 2020-12
- ```json - { - "type": "array", - "contains": { "type": "string" }, - "items": { - "anyOf": [ - { "type": "string" }, - { "type": "number" } - ] +
Draft 2019-09Draft 2020-12
+ ```json + { + "type": "array", + "contains": { "type": "string" }, + "items": { + "anyOf": [ + { "type": "string" }, + { "type": "number" } + ] + } } - } - ``` - - ```json - { - "type": "array", - "contains": { "type": "string" }, - "unevaluatedItems": { "type": "number" } - } - ``` -
+ ```json + { + "type": "array", + "contains": { "type": "string" }, + "unevaluatedItems": { "type": "number" } + } + ``` +
Unfortunately, this change means you may not be able to use `contains` in some @@ -463,7 +473,8 @@ embedded schemas using `$defs`. Here's what the bundled schema would look like. 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 +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. 3. `https://example.com/schema/address` doesn't declare a `$schema`. Because it