Skip to content

Commit

Permalink
Merge branch 'json-schema-org:main' into issue_824
Browse files Browse the repository at this point in the history
  • Loading branch information
29deepanshutyagi authored Jan 13, 2025
2 parents 1c5434c + 4fe7488 commit a5aac0e
Show file tree
Hide file tree
Showing 60 changed files with 709 additions and 176 deletions.
14 changes: 7 additions & 7 deletions components/AmbassadorsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ const SocialIcon = ({ platform }: { platform: SocialIcons }) => {
twitter: (
<svg
className='w-7 h-7 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100'
viewBox='0 0 24 24'
viewBox='0 0 20 16'
fill='currentColor'
xmlns='http://www.w3.org/2000/svg'
>
<path d='M23.954 4.569c-.885.389-1.83.654-2.825.775a4.932 4.932 0 0 0 2.163-2.723 9.85 9.85 0 0 1-3.127 1.195 4.916 4.916 0 0 0-8.374 4.482A13.936 13.936 0 0 1 1.64 3.161 4.916 4.916 0 0 0 3.195 9.86a4.897 4.897 0 0 1-2.229-.616v.061a4.919 4.919 0 0 0 3.946 4.827 4.897 4.897 0 0 1-2.224.085 4.923 4.923 0 0 0 4.604 3.42A9.869 9.869 0 0 1 .977 19.569a13.94 13.94 0 0 0 7.548 2.211c9.056 0 14.012-7.497 14.012-13.986 0-.213-.005-.425-.015-.636A9.936 9.936 0 0 0 24 4.59a9.94 9.94 0 0 1-2.046.561z' />
<path d='M12.6.75h2.454l-5.36 6.142L16 15.25h-4.937l-3.867-5.07-4.425 5.07H.316l5.733-6.57L0 .75h5.063l3.495 4.633L12.601.75Zm-.86 13.028h1.36L4.323 2.145H2.865z' />
</svg>
),
linkedin: (
Expand Down Expand Up @@ -114,15 +114,15 @@ const AmbassadorCard = ({ ambassador }: { ambassador: Ambassador }) => {
contributions = [],
} = ambassador;

const SocialIconss: SocialIcons[] = [
const SocialIcons: SocialIcons[] = [
'github',
'twitter',
'mastodon',
'linkedin',
];

return (
<div className='relative max-w-sm md:max-w-md lg:max-w-lg mx-auto bg-white dark:bg-gray-800 shadow-lg rounded-lg overflow-hidden my-4 transition-all duration-300 h-fit'>
<div className='relative flex flex-col max-w-sm md:max-w-md lg:max-w-lg mx-auto bg-white dark:bg-gray-800 shadow-lg rounded-lg overflow-hidden my-4 h-full'>
<div className='absolute top-0 right-0 w-1 h-20 bg-black dark:bg-gray-400'></div>
<div className='absolute bottom-100 right-0 w-20 h-1 bg-black dark:bg-gray-400'></div>
<div className='absolute bottom-0 left-0 w-1 h-20 bg-black dark:bg-gray-400'></div>
Expand All @@ -137,7 +137,7 @@ const AmbassadorCard = ({ ambassador }: { ambassador: Ambassador }) => {
onError={() => setImgSrc(`/img/ambassadors/${name}.jpg`)}
/>

<div className='p-6'>
<div className='flex flex-col flex-grow p-6'>
<h3 className='text-xl font-semibold mb-2 text-gray-900 dark:text-white'>
{name}
</h3>
Expand All @@ -157,8 +157,8 @@ const AmbassadorCard = ({ ambassador }: { ambassador: Ambassador }) => {
</p>
)}

<div className='flex justify-center mb-4'>
{SocialIconss.map((platform) => {
<div className='flex justify-center mb-4 mt-auto'>
{SocialIcons.map((platform) => {
const username = ambassador[platform];
return username ? (
<a
Expand Down
2 changes: 1 addition & 1 deletion components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ const Footer = () => (
</div>
<div className='text-white font-normal text-center relative m-0 ml-0 mr-1 px-4'>
<p>
Copyright © 2024 JSON Schema.&nbsp;
Copyright &copy; {new Date().getFullYear()} JSON Schema.&nbsp;
<span className='block sm:inline sm:mb-0'>All rights reserved.</span>
</p>
</div>
Expand Down
1 change: 1 addition & 0 deletions components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ export const DocsNav = ({
setOpen={setOpen}
/>
<DocLink uri='/overview/faq' label='FAQ' setOpen={setOpen} />
<DocLink uri='/pro-help' label='Pro Help' setOpen={setOpen} />
<DocLink
uri='/overview/similar-technologies'
label='Similar Technologies'
Expand Down
2 changes: 1 addition & 1 deletion components/StyledMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const StyledMarkdownBlock = ({ markdown }: { markdown: string }) => {
h4: { component: Headline4 },
strong: {
component: ({ children }) => (
<strong className='font-semibold text-slate-800 dark:text-slate-500'>
<strong className='font-semibold text-slate-800 dark:text-slate-200'>
{children}
</strong>
),
Expand Down
1 change: 1 addition & 0 deletions context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const SectionContext = React.createContext<
| 'reference'
| 'roadmap'
| 'ambassador'
| 'pro-help'
>(null);
export const BlockContext = React.createContext<BlockContextValue | null>(null);
export const FullMarkdownContext = React.createContext<string | null>(null);
61 changes: 60 additions & 1 deletion data/tooling-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3046,4 +3046,63 @@
license: 'Apache-2.0'
source: 'https://github.com/pubg/protoc-gen-jsonschema'
supportedDialects:
draft: ['4', '6', '7', '2019-09', '2020-12']
draft: ['4', '6', '7', '2019-09', '2020-12']

- name: swift-json-schema
description: 'swift-json-schema support generating JSON schema using Swift result builders or from Swift types directly using macros.'
environments: ['macOS', 'iOS', 'tvOS', 'watchOS', 'visionOS', 'Linux']
toolingTypes: ['validator', 'code-to-schema', 'model-to-schema']
languages: ['Swift']
maintainers:
- name: 'Austin Evans'
username: 'ajevans99'
platform: 'github'
license: 'MIT'
source: 'https://github.com/ajevans99/swift-json-schema'
supportedDialects:
draft: ['2020-12']

- name: 'Liquid JSON Schema Editor'
description: 'Graphical JSON Schema editor for draft-04, draft-06, draft-07, 2019-09 and 2020-12, with split source code and graphical editing. Includes validation of JSON files based on JSON Schema, JSON Sample Generator and JSON Schema Documentation Generator.'
toolingTypes: ['validator', 'documentation', 'editor']
languages: ['C#', '.NET']
environments: ['Microsoft Windows']
maintainers:
- name: 'Liquid Technologies Ltd'
platform: 'other'
creators:
- name: 'Liquid Technologies Ltd'
platform: 'other'
homepage: 'https://www.liquid-technologies.com/json-schema-editor'
license: 'Proprietary and Freeware'
supportedDialects:
draft: ['4', '6', '7', '2019-09', '2020-12']

- name: 'JSON Schema Editor'
description: 'The JSON schema editor provides an easy UI for building JSON Schema. In addition, users can convert their json schema into SQL, GraphQL, and Protocol Buffers formats. Lastly this tool allows users to generate sample data that conforms to the json schema they have defined.'
toolingTypes: ['editor']
maintainers:
- name: 'robclarabase'
username: 'robclarabase'
platform: 'github'
license: 'MIT'
source: 'https://github.com/Clarabase/json-schema-editor'
homepage: 'https://json-schema-editor.onrender.com/'
supportedDialects:
draft: ['2020-12']

- name: JSV
description: 'A generic JSON Schema validator for Elixir'
environments: ['Linux', 'MacOS', 'Windows','Embedded platform']
toolingTypes: ['validator']
languages: ['Elixir', 'Erlang']
maintainers:
- name: 'Ludovic Demblans'
username: 'lud'
platform: 'github'
license: 'MIT'
source: 'https://github.com/lud/jsv'
homepage: 'https://hex.pm/packages/jsv'
supportedDialects:
draft: ['2020-12', '7']
toolingListingNotes: 'JSON Schema Validation for Elixir according to the latest specifications. Supports compile-time schema builds, custom dialects and custom formats.'
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@docsearch/react": "3.8.0",
"@types/jsonpath": "^0.2.4",
"axios": "1.7.7",
"babel-loader": "^9.1.3",
"babel-loader": "^9.2.1",
"classnames": "^2.5.1",
"feed": "^4.2.2",
"file-saver": "^2.0.5",
Expand All @@ -43,7 +43,7 @@
"next": "14.2.14",
"next-sitemap": "^4.2.3",
"next-themes": "^0.3.0",
"node-ical": "0.19.0",
"node-ical": "0.20.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-syntax-highlighter": "^15.6.1",
Expand Down
7 changes: 7 additions & 0 deletions pages/[slug].page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps';
import { Headline1 } from '~/components/Headlines';
import { SectionContext } from '~/context';
import { DocsHelp } from '~/components/DocsHelp';
import NextPrevButton from '~/components/NavigationButtons';

export async function getStaticPaths() {
return getStaticMarkdownPaths('pages');
Expand All @@ -31,6 +32,12 @@ export default function StaticMarkdownPage({
</Head>
<Headline1>{frontmatter.title}</Headline1>
<StyledMarkdown markdown={content} />
<NextPrevButton
prevLabel={frontmatter?.prev?.label}
prevURL={frontmatter?.prev?.url}
nextLabel={frontmatter?.next?.label}
nextURL={frontmatter?.next?.url}
/>
<DocsHelp markdownFile={markdownFile} />
</SectionContext.Provider>
);
Expand Down
7 changes: 7 additions & 0 deletions pages/implementers/[slug].page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps';
import { Headline1 } from '~/components/Headlines';
import { SectionContext } from '~/context';
import { DocsHelp } from '~/components/DocsHelp';
import NextPrevButton from '~/components/NavigationButtons';

export async function getStaticPaths() {
return getStaticMarkdownPaths('pages/implementers');
Expand All @@ -31,6 +32,12 @@ export default function StaticMarkdownPage({
</Head>
<Headline1>{frontmatter.title}</Headline1>
<StyledMarkdown markdown={content} />
<NextPrevButton
prevLabel={frontmatter?.prev?.label}
prevURL={frontmatter?.prev?.url}
nextLabel={frontmatter?.next?.label}
nextURL={frontmatter?.next?.url}
/>
<DocsHelp markdownFile={markdownFile} />
</SectionContext.Provider>
);
Expand Down
6 changes: 6 additions & 0 deletions pages/implementers/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
---
title: "For Implementers"
section: docs
prev:
label: Structuring a complex schema
url: /understanding-json-schema/structuring
next:
label: Common Interfaces across Implementations
url: /implementers/interfaces
---

For Implementers
Expand Down
17 changes: 15 additions & 2 deletions pages/implementers/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import StyledMarkdown from '~/components/StyledMarkdown';
import { DocsHelp } from '~/components/DocsHelp';
import { SectionContext } from '~/context';
import Card from '~/components/Card';
import NextPrevButton from '~/components/NavigationButtons';

export async function getStaticProps() {
const block1 = fs.readFileSync('pages/implementers/_index.md', 'utf-8');
Expand All @@ -17,13 +18,19 @@ export async function getStaticProps() {
};
}

export default function ContentExample({ blocks }: { blocks: any[] }) {
export default function ContentExample({
blocks,
}: {
blocks: any[];
frontmatter: any;
content: any;
}) {
const markdownFile = '_indexPage';

return (
<SectionContext.Provider value='docs'>
<StyledMarkdown markdown={blocks[0]} />
<section className='mt-10'>
<section className='my-10'>
<div className='grid grid-cols-1 md:grid-cols-2 gap-4 w-12/12 md:w-11/12 lg:w-10/12 xl:w-10/12 m-auto'>
<Card
key='common-interfaces'
Expand All @@ -45,6 +52,12 @@ export default function ContentExample({ blocks }: { blocks: any[] }) {
/>
</div>
</section>
<NextPrevButton
prevLabel='Structuring a complex schema'
prevURL='/understanding-json-schema/structuring'
nextLabel='Common Interfaces across Implementations'
nextURL='/implementers/interfaces'
/>
<DocsHelp markdownFile={markdownFile} />
</SectionContext.Provider>
);
Expand Down
6 changes: 6 additions & 0 deletions pages/implementers/interfaces.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
---
title: Common Interfaces across JSON Schema Implementations
section: implementers
prev:
label: For Implementers
url: /implementers
next:
label: Specification
url: /specification
---

JSON Schema is extremely widely used and nearly equally widely implemented.
Expand Down
8 changes: 6 additions & 2 deletions pages/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -576,13 +576,17 @@ const Home = (props: any) => {
className='border-b border-black'
>
sponsor
</a>{' '}
or a{' '}
</a>
, a{' '}
<a
href='https://json-schema.org/overview/sponsors#benefits-of-being-an-individual-backer'
className='border-b border-black '
>
backer
</a>{' '}
or hiring our{' '}
<a href='/pro-help' className='border-b border-black'>
pro services
</a>
.
</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
---
title: Creating your first schema
section: docs
prev:
label: Overview
url: /learn
next:
label: Miscellaneous examples
url: /learn/miscellaneous-examples
---

JSON Schema is a vocabulary that you can use to annotate and validate JSON documents. This tutorial guides you through the process of creating a JSON Schema.
Expand Down
15 changes: 14 additions & 1 deletion pages/learn/getting-started-step-by-step/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import StyledMarkdown from '~/components/StyledMarkdown';
import { SectionContext } from '~/context';
import { DocsHelp } from '~/components/DocsHelp';
import GettingStarted from '~/components/GettingStarted';
import NextPrevButton from '~/components/NavigationButtons';

export async function getStaticProps() {
const block1 = fs.readFileSync(
Expand All @@ -28,7 +29,13 @@ export async function getStaticProps() {
};
}

export default function StyledValidator({ blocks }: { blocks: any[] }) {
export default function StyledValidator({
blocks,
}: {
blocks: any[];
frontmatter: any;
content: any;
}) {
const newTitle = 'Creating your first schema';

return (
Expand All @@ -40,6 +47,12 @@ export default function StyledValidator({ blocks }: { blocks: any[] }) {
<StyledMarkdown markdown={blocks[0]} />
<GettingStarted />
<StyledMarkdown markdown={blocks[1]} />
<NextPrevButton
prevLabel='Overview'
prevURL='/learn'
nextLabel='Miscellaneous examples'
nextURL='/learn/miscellaneous-examples'
/>
<DocsHelp />
</SectionContext.Provider>
);
Expand Down
6 changes: 6 additions & 0 deletions pages/learn/glossary.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
---
title: JSON Schema Glossary
section: docs
prev:
label: Other Examples
url: /learn/json-schema-examples
next:
label: JSON Schema Keywords
url: /understanding-json-schema/keywords
---

This document collects short explanations of terminology one may encounter within the JSON Schema community.
Expand Down
7 changes: 7 additions & 0 deletions pages/learn/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Headline1 } from '~/components/Headlines';
import { SectionContext } from '~/context';
import Card from '~/components/Card';
import { DocsHelp } from '~/components/DocsHelp';
import NextPrevButton from '~/components/NavigationButtons';

export default function Welcome() {
const markdownFile = '_indexPage';
Expand Down Expand Up @@ -39,6 +40,12 @@ export default function Welcome() {
link='https://tour.json-schema.org/'
/>
</div>
<NextPrevButton
prevLabel='Code of Conduct'
prevURL='/overview/code-of-conduct'
nextLabel='Creating your first Schema'
nextURL='/learn/getting-started-step-by-step'
/>
<DocsHelp markdownFile={markdownFile} />
</SectionContext.Provider>
);
Expand Down
4 changes: 2 additions & 2 deletions pages/learn/json-schema-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ prev:
label: Modeling a file system
url: /learn/file-system
next:
label: Miscellaneous examples
url: /learn/miscellaneous-examples
label: JSON Scehma Glossary
url: /learn/glossary
---

In this page, you will find examples illustrating different use cases to help you get the most out of your JSON Schemas. These examples cover a wide range of scenarios, and each example comes with accompanying JSON data and explanation, showcasing how JSON Schemas can be applied to various domains. You can modify these examples to suit your specific needs, as this is just one of the many ways you can utilize JSON Schemas.
Expand Down
Loading

0 comments on commit a5aac0e

Please sign in to comment.