Skip to content

Commit

Permalink
fix: yarn file (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaSingh-02 committed Mar 11, 2024
1 parent f245063 commit 74711cd
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 112 deletions.
4 changes: 3 additions & 1 deletion components/StyledMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ const StyledMarkdownBlock = ({ markdown }: { markdown: string }) => {
},
table: {
component: ({ children }) => (
<table className='table-auto mb-8'>{children}</table>
<div className='max-w-[100%] mx-auto mb-8 overflow-auto'>
<table className='table-auto'>{children}</table>
</div>
),
},
thead: {
Expand Down
233 changes: 122 additions & 111 deletions pages/draft/2020-12/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,96 +33,102 @@ Here are some examples to illustrate the changes.

### Open tuple
<table>
<tr>
<th>Draft 2019-09</th>
<th>Draft 2020-12</th>
</tr>
<tr>
<td>
```json
{
"items": [
{ "$ref": "#/$defs/foo" },
{ "$ref": "#/$defs/bar" }
]
}
```
</td>
<td>
```json
{
"prefixItems": [
{ "$ref": "#/$defs/foo" },
{ "$ref": "#/$defs/bar" }
]
}
```
</td>
</tr>
<tbody>
<tr>
<th>Draft 2019-09</th>
<th>Draft 2020-12</th>
</tr>
<tr>
<td>
```json
{
"items": [
{ "$ref": "#/$defs/foo" },
{ "$ref": "#/$defs/bar" }
]
}
```
</td>
<td>
```json
{
"prefixItems": [
{ "$ref": "#/$defs/foo" },
{ "$ref": "#/$defs/bar" }
]
}
```
</td>
</tr>
</tbody>
</table>

### Closed tuple
<table>
<tr>
<th>Draft 2019-09</th>
<th>Draft 2020-12</th>
</tr>
<tr>
<td>
```json
{
"items": [
{ "$ref": "#/$defs/foo" },
{ "$ref": "#/$defs/bar" }
],
"additionalItems": false
}
```
</td>
<td>
```json
{
"prefixItems": [
{ "$ref": "#/$defs/foo" },
{ "$ref": "#/$defs/bar" }
],
"items": false
}
```
</td>
</tr>
<tbody>
<tr>
<th>Draft 2019-09</th>
<th>Draft 2020-12</th>
</tr>
<tr>
<td>
```json
{
"items": [
{ "$ref": "#/$defs/foo" },
{ "$ref": "#/$defs/bar" }
],
"additionalItems": false
}
```
</td>
<td>
```json
{
"prefixItems": [
{ "$ref": "#/$defs/foo" },
{ "$ref": "#/$defs/bar" }
],
"items": false
}
```
</td>
</tr>
</tbody>
</table>

### Tuple with constrained additional items
<table>
<tr>
<th>Draft 2019-09</th>
<th>Draft 2020-12</th>
</tr>
<tr>
<td>
```json
{
"items": [
{ "$ref": "#/$defs/foo" },
{ "$ref": "#/$defs/bar" }
],
"additionalItems": { "$ref": "#/$defs/baz" }
}
```
</td>
<td>
```json
{
"prefixItems": [
{ "$ref": "#/$defs/foo" },
{ "$ref": "#/$defs/bar" }
],
"items": { "$ref": "#/$defs/baz" }
}
```
</td>
</tr>
<tbody>
<tr>
<th>Draft 2019-09</th>
<th>Draft 2020-12</th>
</tr>
<tr>
<td>
```json
{
"items": [
{ "$ref": "#/$defs/foo" },
{ "$ref": "#/$defs/bar" }
],
"additionalItems": { "$ref": "#/$defs/baz" }
}
```
</td>
<td>
```json
{
"prefixItems": [
{ "$ref": "#/$defs/foo" },
{ "$ref": "#/$defs/bar" }
],
"items": { "$ref": "#/$defs/baz" }
}
```
</td>
</tr>
</tbody>
</table>

## $dynamicRef and $dynamicAnchor
Expand All @@ -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`.

<table>
<tbody>
<tr>
<th>Draft 2019-09</th>
<th>Draft 2020-12</th>
Expand Down Expand Up @@ -209,6 +216,7 @@ Here's how you would covert a schema using `$recursiveRef` to use `$dynamicRef`.
```
</td>
</tr>
</tbody>
</table>


Expand All @@ -224,35 +232,37 @@ that has some item matching one schema and everything else matching another
schema.

<table>
<tr>
<th>Draft 2019-09</th>
<th>Draft 2020-12</th>
</tr>
<tr>
<td>
```json
{
"type": "array",
"contains": { "type": "string" },
"items": {
"anyOf": [
{ "type": "string" },
{ "type": "number" }
]
<tbody>
<tr>
<th>Draft 2019-09</th>
<th>Draft 2020-12</th>
</tr>
<tr>
<td>
```json
{
"type": "array",
"contains": { "type": "string" },
"items": {
"anyOf": [
{ "type": "string" },
{ "type": "number" }
]
}
}
}
```
</td>
<td>
```json
{
"type": "array",
"contains": { "type": "string" },
"unevaluatedItems": { "type": "number" }
}
```
</td>
</tr>
```
</td>
<td>
```json
{
"type": "array",
"contains": { "type": "string" },
"unevaluatedItems": { "type": "number" }
}
```
</td>
</tr>
</tbody>
</table>

Unfortunately, this change means you may not be able to use `contains` in some
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 74711cd

Please sign in to comment.