Skip to content

Commit

Permalink
Merge branch 'json-schema-org:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Akshaybagai52 authored Mar 11, 2024
2 parents 9ed5e94 + 29cd1c6 commit 9655bb2
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 118 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/welcome-first-time-contrib.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Greeting the new contributor

on: [pull_request, issues]

on:
pull_request:
types: [opened]
issues:
types: [opened]

jobs:
greeting:
runs-on: ubuntu-latest
Expand Down
16 changes: 16 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
##############################################################
#
# List of approvers/reviewers for JSON Schema website
#
##############################################################
#
# Get in touch with us via the JSON Schema Community
# https://json-schema.org/#community
#
#
# Learn about CODEOWNERS file format:
# https://help.github.com/en/articles/about-code-owners
#

# This group will be the default group approving/reviewing PRs
* @json-schema-org/web-team
2 changes: 1 addition & 1 deletion components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function Layout({
<main
className={classnames(
mainClassName,
'z-10 xl:rounded-xl pt-4 mx-auto',
'z-10 h-screen xl:rounded-xl pt-4 mx-auto',
)}
>
<header
Expand Down
2 changes: 1 addition & 1 deletion components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export const SidebarLayout = ({ children }: { children: React.ReactNode }) => {
</div>
</div>

<div className='max-w-[1400px] mx-auto grid grid-cols-1 lg:grid-cols-4 mx-4 md:mx-12'>
<div className='max-w-[1400px] grid grid-cols-1 lg:grid-cols-4 mx-4 md:mx-12'>
<div className='hidden lg:block mt-24'>
<DocsNav />
<CarbonAds
Expand Down
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
4 changes: 2 additions & 2 deletions pages/implementations/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function ImplementationTable({
const router = useRouter();
return (
<>
<div className='flex flex-row flex-wrap grid-cols-7 grid'>
<div className='flex flex-row flex-wrap grid grid-cols-3 text-sm md:grid-cols-5 md:text-base lg:grid-cols-6'>
{implementationsByLanguage.map(
(implementationByLanguage: any, index: number) => {
const slug =
Expand All @@ -95,7 +95,7 @@ function ImplementationTable({
key={index}
href={`#${slug}`}
className={classnames(
'block text-center text-white rounded p-2 cursor-pointer flex-1 m-1',
'text-white rounded p-3 cursor-pointer flex items-center justify-center m-1',
{
'bg-blue-800': isActive,
'bg-blue-500 hover:bg-blue-600': !isActive,
Expand Down

0 comments on commit 9655bb2

Please sign in to comment.