Skip to content

fixed some typos in the tour website #162

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

Merged
merged 1 commit into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords: "types, combining types, boolean, null, JSON Schema"

# Combining Types - Boolean and Null

In out previous examples, we have set the types of properties as `string` and `integer`. But **what if you want to combine different types for a single property?**
In our previous examples, we have set the types of properties as `string` and `integer`. But **what if you want to combine different types for a single property?**

Let's add a new property `hasAgreedToTerms` to the JSON object. This property should be a `boolean` value, but it can also be `null`.

Expand Down Expand Up @@ -51,4 +51,4 @@ In JSON Schema, you can define multiple types by passing **an array of types** t



Now, try to modify the `hasAgreedToTerms` property on the <SideEditorLink/> to accept both `boolean` and `null` values.
Now, try to modify the `hasAgreedToTerms` property on the <SideEditorLink/> to accept both `boolean` and `null` values.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ We want to ensure that each property names are written in capital letters. We ca
}
```

You are given an empty object schema in the <SideEditorLink/>. Modify it ensure that it follows the below constraints:
You are given an empty object schema in the <SideEditorLink/>. Modify it to ensure that it follows the below constraints:

1. The object should have at **least 2 properties**.
2. The **property names** should be written **in capital letters**, and should have **minimum length of 3 characters**.
Expand All @@ -33,4 +33,4 @@ You are given an empty object schema in the <SideEditorLink/>. Modify it ensure
> **Hints:**
> - For the first constraint, you can use the `minProperties` keyword.
> - For the second constraint, you can use the `propertyNames` keyword with the `pattern` keyword.
> - For the third constraint, you can use the `additionalProperties` keyword with the `type` keyword.
> - For the third constraint, you can use the `additionalProperties` keyword with the `type` keyword.
2 changes: 1 addition & 1 deletion content/04-Arrays/03-Tuple-Validation/instructions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ We want to display the address of a person. The address is represented as an arr
}
```

each element of the `address` array have constraints of their own:
each element of the `address` array has constraints of its own:

- `number` should be an integer
- `street_name` should be a string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Ensuring Array Content with the 'contains'
title: Ensuring Array Content with the 'contains' keyword
description: "Learn how to use the 'contains' keyword in JSON Schema to validate arrays, ensuring they contain specific elements like numbers or strings, with examples and tasks."
keywords: "array, contains, validation, JSON Schema, subschema, keyword, example, task, skills, const"
---

# Ensuring Array Content with the 'contains'
# Ensuring Array Content with the 'contains' keyword

The `contains` keyword is used to ensure that an array contains **at least one element** that matches the [subschema](https://json-schema.org/learn/glossary#subschema) defined in the `contains` [keyword](https://json-schema.org/learn/glossary#keyword).

Expand Down Expand Up @@ -35,4 +35,4 @@ Our employee document has a field called `skills`.

Now, we want to ensure that the `skills` array contains at least one element that is equal to `"JavaScript"`. modify the schema given to you in the <SideEditorLink/> to apply this constrain.

> **Hint:** Use the `const` keyword to specify JavaScript as the required element.
> **Hint:** Use the `const` keyword to specify JavaScript as the required element.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ The following example demonstrates how to use the `minContains` and `maxContains
}
```

Our employee has field called worked hours. We want to ensure that the `workedHours` array contains **at least 2 elements** that are **greater than or equal to 8 and less than or equal 12**. Modify the schema given to you in the <SideEditorLink/> to apply this constraint.
Our employee has a field called worked hours. We want to ensure that the `workedHours` array contains **at least 2 elements** that are **greater than or equal to 8 and less than or equal 12**. Modify the schema given to you in the <SideEditorLink/> to apply this constraint.


Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords: "dependentRequired, conditional validation, JSON Schema, dependentSche


# Conditional Validation
Congratulations! You have made so far. We will learn about conditional validation in module
Congratulations! You have made it so far. We will learn about conditional validation in this module


## What is Conditional Validation?
Expand Down Expand Up @@ -65,4 +65,4 @@ The value of the `dependentRequired` keyword is an object. Each entry in the obj
}
```

You are given a *Schema* for the above JSON document in the <SideEditorLink/>. Update the schema to make sure that if the `creditCardNumber` property is present, then the `address` property must also be present.
You are given a *Schema* for the above JSON document in the <SideEditorLink/>. Update the schema to make sure that if the `creditCardNumber` property is present, then the `address` property must also be present.