-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
New information architecture #1194
Open
valeriahhdez
wants to merge
7
commits into
json-schema-org:main
Choose a base branch
from
valeriahhdez:new-information-architecture
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+522
−236
Open
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9fa2e26
Change sidebar names
valeriahhdez 46a4492
Change sidebar names
valeriahhdez c373ea5
Change structure of reference content bucket
valeriahhdez e2a423e
Merge branch 'json-schema-org:main' into new-information-architecture
valeriahhdez 63b59cf
Create Guides content bucket, add overview pages to every bucket
valeriahhdez 6f8c248
Modify type.md to provide context about to readers
valeriahhdez a01a0bc
Remove unsed import
valeriahhdez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,7 +121,7 @@ | |
"C#", | ||
"Go", | ||
"C++", | ||
"JavaScript", | ||
"JavaScript", | ||
"Julia" | ||
] | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import { getLayout } from '~/components/Sidebar'; | ||
import Head from 'next/head'; | ||
import { Headline1 } from '~/components/Headlines'; | ||
import { SectionContext } from '~/context'; | ||
import Card from '~/components/Card'; | ||
import { DocsHelp } from '~/components/DocsHelp'; | ||
|
||
export default function Welcome() { | ||
const markdownFile = '_indexPage'; | ||
|
||
const newTitle = 'Guides'; | ||
return ( | ||
<SectionContext.Provider value='learn'> | ||
<Head> | ||
<title>{newTitle}</title> | ||
</Head> | ||
<Headline1>{newTitle}</Headline1> | ||
<p> | ||
Documentation coming soon! | ||
<br /> | ||
</p> | ||
<div className='w-full lg:w-full grid grid-cols-1 sm:grid-cols-2 gap-6 my-[10px] mx-auto mt-8'></div> | ||
<DocsHelp markdownFile={markdownFile} /> | ||
</SectionContext.Provider> | ||
); | ||
} | ||
Welcome.getLayout = getLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: "Schema composition" | ||
section: docs | ||
--- | ||
|
||
JSON Schema offers powerful features for constructing complex and flexible schema structures. The main approaches to combining JSON schemas are the following: | ||
|
||
- **Modular combination**. This approach allows you to break down your data model into reusable components, fostering modularity, and maintainability. In [Modular JSON Schema combination](../../understanding-json-schema/reference/structuring) you will learn about creating and utilizing reusable schemas, subschemas, and even self-referential (recursive) schemas. | ||
|
||
- **Boolean combination**. This approach allows you to validate a single data value against multiple criteria at the same time. JSON Schema provides a set of keywords that act like boolean operators (AND, OR, NOT) to achieve this. To enhance your understanding of these keywords and learn how to leverage them for complex validations, see [Boolean JSON Schema combination](../../understanding-json-schema/reference/combining). | ||
|
||
By mastering these techniques you will make your JSON schemas more scalable, flexible, and easy to maintain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
--- | ||
title: "Generic keywords" | ||
title: "Value restrictions" | ||
section: docs | ||
--- | ||
|
||
* [Annotations](../../understanding-json-schema/reference/annotations) | ||
* [Comments](../../understanding-json-schema/reference/comments) | ||
* [Enumerated values](../../understanding-json-schema/reference/enum) | ||
* [Constant values](../../understanding-json-schema/reference/const) | ||
The `enum` and `const` keywords contribute to data validation by defining limits on the values a property can hold. | ||
|
||
- **Define a set of values**. Use the `enum` keyword to specify a finite set of acceptable values for a property. This ensures that only predefined options are valid. | ||
|
||
- **Define a fixed, single value**. Use the `const` keyword to force a property to have a single, fixed value. This keyword is more restrictive than `enum`. | ||
|
||
Learn more about how to use these keywords with the following resources: | ||
|
||
- [Enumerated values](../../understanding-json-schema/reference/enum) | ||
- [Constant values](../../understanding-json-schema/reference/const) | ||
|
||
By effectively utilizing these keywords, you can significantly enhance the reliability and accuracy of your JSON data. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,84 @@ | ||
import React from 'react'; | ||
import { getLayout } from '~/components/Sidebar'; | ||
import fs from 'fs'; | ||
import matter from 'gray-matter'; | ||
import StyledMarkdown from '~/components/StyledMarkdown'; | ||
import Head from 'next/head'; | ||
import { Headline1 } from '~/components/Headlines'; | ||
import { SectionContext } from '~/context'; | ||
import Card from '~/components/Card'; | ||
import { DocsHelp } from '~/components/DocsHelp'; | ||
|
||
export async function getStaticProps() { | ||
const block1 = fs.readFileSync( | ||
'pages/understanding-json-schema/reference/_index.md', | ||
'utf-8', | ||
); | ||
const { content: block1Content } = matter(block1); | ||
return { | ||
props: { | ||
blocks: [block1Content], | ||
}, | ||
}; | ||
} | ||
|
||
export default function ContentExample({ blocks }: { blocks: any[] }) { | ||
export default function Welcome() { | ||
const markdownFile = '_indexPage'; | ||
|
||
const newTitle = 'JSON Schema Reference'; | ||
return ( | ||
<SectionContext.Provider value='docs'> | ||
<StyledMarkdown markdown={blocks[0]} /> | ||
<SectionContext.Provider value='learn'> | ||
<Head> | ||
<title>{newTitle}</title> | ||
</Head> | ||
<Headline1>{newTitle}</Headline1> | ||
<p> | ||
Master the full power of JSON Schema with our reference documentation. | ||
<br /> | ||
<br /> | ||
From basic data types to advanced techniques like conditional validation | ||
and schema composition, you will learn everything about JSON Schema | ||
keywords through clear explanations and examples. By learning best | ||
practices for building clear, scalable, and easy-to-maintain schemas, | ||
you will ensure that your JSON data is both robust and flexible. | ||
<br /> | ||
</p> | ||
<div className='w-full lg:w-full grid grid-cols-1 sm:grid-cols-2 gap-6 my-[10px] mx-auto mt-8'> | ||
<Card | ||
title='Learn JSON Schema' | ||
body='Improve your JSON Schema skills with this reference, crafted by our TSC members, offering practical examples, best practices, and common pitfalls.' | ||
headerSize='medium' | ||
bodyTextSize='small' | ||
extended={true} | ||
link='https://www.learnjsonschema.com/2020-12/' | ||
/> | ||
<Card | ||
title='Keywords' | ||
body='Browse our comprehensive index of JSON Schema keywords, each linking to detailed documentation.' | ||
headerSize='medium' | ||
bodyTextSize='small' | ||
extended={true} | ||
link='https://tour.json-schema.org/' | ||
/> | ||
<Card | ||
title='Data types' | ||
body='Become profficient at using the type keyword to validate your data.' | ||
headerSize='medium' | ||
bodyTextSize='small' | ||
extended={true} | ||
link='https://tour.json-schema.org/' | ||
/> | ||
<Card | ||
title='Value restrictions' | ||
body='Ensure data consistency and accuracy, by defining value sets and fixed values for your JSON properties.' | ||
headerSize='medium' | ||
bodyTextSize='small' | ||
extended={true} | ||
link='https://tour.json-schema.org/' | ||
/> | ||
<Card | ||
title='Annotations and comments' | ||
body='Enhance your JSON Schemas with annotations and comments. Learn how to add descriptions, defaults, examples, and more to improve readability and maintainability.' | ||
headerSize='medium' | ||
bodyTextSize='small' | ||
extended={true} | ||
link='https://tour.json-schema.org/' | ||
/> | ||
<Card | ||
title='Schema composition' | ||
body='Learn how to combine JSON Schemas using modular and boolean techniques to create flexible and maintainable data models.' | ||
headerSize='medium' | ||
bodyTextSize='small' | ||
extended={true} | ||
link='https://tour.json-schema.org/' | ||
/> | ||
</div> | ||
<DocsHelp markdownFile={markdownFile} /> | ||
</SectionContext.Provider> | ||
); | ||
} | ||
ContentExample.getLayout = getLayout; | ||
Welcome.getLayout = getLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
title: "Schema annotations and comments" | ||
section: docs | ||
--- | ||
|
||
Annotations and comments are not directly related to the core structure and constraints of the JSON Schema itself. As such, keywords for annotations and comments are not required, however, using them can improve the maintainability of your schemas. | ||
|
||
Annotations are optional pieces of information that provide additional context or meaning to a JSON Schema. They are not used for data validation but can serve various purposes, such as: | ||
|
||
- **Descriptions**. Adding human-readable descriptions to properties or the entire schema. | ||
- **Defaults**. Specifying default values for properties. | ||
- **Examples**. Providing example JSON objects that validate against the schema. | ||
- **ReadOnly/WriteOnly**. Indicating read-only or write-only properties (often used in API contexts). | ||
- **Deprecated**. Marking properties or features that are discouraged from use and might be removed in the future. | ||
|
||
|
||
While annotations don't enforce data validation, they play a valuable role in enhancing the clarity, usability, and maintainability of JSON Schemas. | ||
|
||
Unlike some programming languages, JSON Schema itself doesn't natively support comments. However, it provides the keyword `$comment`, which allows schema authors to add comments within their schema. These comments enhance the clarity and maintainability of your schemas; they're intended for schema maintainers and are invisible to applications using the schema for validation. | ||
|
||
By incorporating annotations and comments into your schemas you can improve their clarity, maintainability, and overall quality. This will ensure your schemas are easier to understand and managed over time. | ||
|
||
To get started, explore the following resources: | ||
|
||
- [Annotations](../../understanding-json-schema/reference/annotations) | ||
- [Comments](../../understanding-json-schema/reference/comments) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls. remove this unused import