From 24a64e164bf86b1d1c2e783073930628bdcfc249 Mon Sep 17 00:00:00 2001 From: Akanksha Kushwaha Date: Mon, 10 Jul 2023 23:11:07 +0530 Subject: [PATCH 1/7] docs: update miscellaneous examples section Signed-off-by: Akanksha Kushwaha --- pages/learn/miscellaneous-examples.md | 259 +++++++++++++++++++++++++- 1 file changed, 257 insertions(+), 2 deletions(-) diff --git a/pages/learn/miscellaneous-examples.md b/pages/learn/miscellaneous-examples.md index e57740449..a6490fe5b 100644 --- a/pages/learn/miscellaneous-examples.md +++ b/pages/learn/miscellaneous-examples.md @@ -51,9 +51,12 @@ This example provides a typical minimum you are likely to see in JSON Schema. It } ``` -## Describing geographical coordinates. +In the data example, we provide values for the `firstName`, `lastName`, and `age` properties. The values match the defined schema, where `firstName` is a string, `lastName` is a string, and `age` is an integer greater than or equal to zero. -This example introduces: + +## Describing geographical coordinates + +In this schema, we define an object representing geographical coordinates. This example also introduces the following keywords: * [`required`](https://json-schema.org/draft/2020-12/json-schema-validation.html#rfc.section.6.5.3) validation keyword * [`minimum`](https://json-schema.org/draft/2020-12/json-schema-validation.html#rfc.section.6.2.4) validation keyword @@ -91,6 +94,9 @@ This example introduces: } ``` +The provided data contains the latitude and longitude values, both falling within the specified minimum and maximum ranges. + + ## Arrays of things Arrays are fundamental structures in JSON -- here we demonstrate a couple of ways they can be described: @@ -103,6 +109,17 @@ We also introduce the following with this example: * [`$defs`](https://json-schema.org/draft/2020-12/json-schema-core.html#rfc.section.8.2.4) keyword * [`$ref`](https://json-schema.org/draft/2020-12/json-schema-core.html#rfc.section.8.2.3.1) keyword +For the `fruits` property: + +* `type` is set to "array" to indicate it's an array. +* `items` describes the items within the array. In this case, they should be of type "string". + +For the `vegetables` property: + +* `type` is also set to "array" to indicate it's an array. +* `items` references the `$defs/veggie` definition, indicating that the items in the array should conform to the "veggie" schema defined in the `$defs` section. + + ```json { "$id": "https://example.com/arrays.schema.json", @@ -157,3 +174,241 @@ We also introduce the following with this example: ] } ``` + +The data example shows the usage of arrays. The `fruits` property contains an array of strings, while the `vegetables` property contains an array of objects, each adhering to the "veggie" schema definition. + + +## Enumerated values + +This example introduces the [enum]() validation keyword and defines an object with a property called "status" that only allows specific enumerated values: "active", "inactive", and "pending". + +```json +{ + "$id": "https://example.com/enumerated-values.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Enumerated Values", + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": ["active", "inactive", "pending"] + } + } +} +``` + +**Data** + +```json +{ + "status": "active" +} +``` + +The provided data adheres to the schema by using the value "active" for the `status` property. + + +## Regular expression pattern + +This example introduces the [pattern]() keyword and defines an object with a property called `code` that must match a specific regular expression pattern: `^[A-Z]{3}-\d{3}$`. The pattern here requires three uppercase letters followed by a hyphen and three digits. + +```json +{ + "$id": "https://example.com/regex-pattern.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Regular Expression Pattern", + "type": "object", + "properties": { + "code": { + "type": "string", + "pattern": "^[A-Z]{3}-\\d{3}$" + } + } +} +``` + +**Data** + +```json +{ + "code": "ABC-123" +} +``` + +The provided data, "ABC-123", satisfies this pattern defined in the schema. + + +## Complex object with nested properties + +The schema below represents a complex object with various properties including `name`, `age`, `address`, and `hobbies`. The `address` property is an object with nested properties, and the `hobbies` property is an array of strings. The `name` and `age` properties are required. + +```json +{ + "$id": "https://example.com/complex-object.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Complex Object", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "integer", + "minimum": 0 + }, + "address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "postalCode": { + "type": "string", + "pattern": "\\d{5}" + } + }, + "required": ["street", "city", "state", "postalCode"] + }, + "hobbies": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["name", "age"] +} +``` + +**Data** + +```json +{ + "name": "John Doe", + "age": 25, + "address": { + "street": "123 Main St", + "city": "New York", + "state": "NY", + "postalCode": "10001" + }, + "hobbies": ["reading", "running"] +} +``` + +The provided data conforms to the schema by including values for the required properties and ensuring the `age` is an integer greater than or equal to zero. The `address` object contains all the necessary properties, and the `hobbies` property is an array of strings. + + +## Conditional validation with dependencies + +The schema below defines an object with two properties: `isMember` and `membershipNumber`. The `membershipNumber` property is required and must have a length of 10 characters only when the `isMember` property is set to true. + +```json +{ + "$id": "https://example.com/conditional-validation.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Conditional Validation", + "type": "object", + "properties": { + "isMember": { + "type": "boolean" + }, + "membershipNumber": { + "type": "string", + "maxLength": 10, + "minLength": 10, + "dependencies": { + "isMember": true + } + } + } +} +``` + +**Data** + +```json +{ + "isMember": true, + "membershipNumber": "1234567890" +} +``` + +The `dependencies` keyword is used to enforce the presence of the `membershipNumber` property when `isMember` is set to true. The provided data satisfies these conditions. + + +## Conditional validation with if-else + +In this schema, we have two properties: `isMember` and `membershipNumber`. The conditional validation is based on the value of the `isMember` property. Here's how the validation works: + +If the value of `isMember` is true: +* The then block is applied, which specifies that the `membershipNumber` property should be a string with a minimum length of 10 and a maximum length of 10. + +If the value of `isMember` is anything other than true: +* The else block is applied, which specifies that the `membershipNumber` property can be any string. + +```json +{ + "$id": "https://example.com/conditional-validation-if-else.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Conditional Validation with If-Else", + "type": "object", + "properties": { + "isMember": { + "type": "boolean" + }, + "membershipNumber": { + "type": "string" + } + }, + "if": { + "properties": { + "isMember": { + "const": true + } + } + }, + "then": { + "properties": { + "membershipNumber": { + "type": "string", + "minLength": 10, + "maxLength": 10 + } + } + }, + "else": { + "properties": { + "membershipNumber": { + "type": "string" + } + } + } +} +``` + +**Data** + +```json +{ + "isMember": true, + "membershipNumber": "1234567890" +} +``` + +In this case, the `isMember` property is set to true, so the then block is applied. The `membershipNumber` property is a string with a length of 10 characters, satisfying the validation. + +```json +{ + "isMember": false, + "membershipNumber": "ABC123" +} +``` + +In this case, the `isMember` property is false, so the else block is applied. The `membershipNumber` property can be any string, so it satisfies the validation. \ No newline at end of file From cb430536a835519427bc3ec64ab01219ab0cd1d4 Mon Sep 17 00:00:00 2001 From: Akanksha Kushwaha Date: Tue, 11 Jul 2023 10:23:01 +0530 Subject: [PATCH 2/7] docs: added hyperlinks to some keywords Signed-off-by: Akanksha Kushwaha --- pages/learn/miscellaneous-examples.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pages/learn/miscellaneous-examples.md b/pages/learn/miscellaneous-examples.md index a6490fe5b..c6d9eefc4 100644 --- a/pages/learn/miscellaneous-examples.md +++ b/pages/learn/miscellaneous-examples.md @@ -180,7 +180,7 @@ The data example shows the usage of arrays. The `fruits` property contains an ar ## Enumerated values -This example introduces the [enum]() validation keyword and defines an object with a property called "status" that only allows specific enumerated values: "active", "inactive", and "pending". +This example introduces the `enum` validation keyword and defines an object with a property called "status" that only allows specific enumerated values: "active", "inactive", and "pending". ```json { @@ -210,7 +210,7 @@ The provided data adheres to the schema by using the value "active" for the `sta ## Regular expression pattern -This example introduces the [pattern]() keyword and defines an object with a property called `code` that must match a specific regular expression pattern: `^[A-Z]{3}-\d{3}$`. The pattern here requires three uppercase letters followed by a hyphen and three digits. +This example introduces the [pattern](https://json-schema.org/draft/2020-12/json-schema-core.html#name-regular-expressions) keyword and defines an object with a property called `code` that must match a specific regular expression pattern: `^[A-Z]{3}-\d{3}$`. The pattern here requires three uppercase letters followed by a hyphen and three digits. ```json { @@ -345,7 +345,9 @@ The `dependencies` keyword is used to enforce the presence of the `membershipNum ## Conditional validation with if-else -In this schema, we have two properties: `isMember` and `membershipNumber`. The conditional validation is based on the value of the `isMember` property. Here's how the validation works: +In this schema, we have two properties: `isMember` and `membershipNumber`. The conditional validation is based on the value of the `isMember` property. The validation keywords [if](https://json-schema.org/draft/2020-12/json-schema-core.html#section-10.2.2.1), [then](https://json-schema.org/draft/2020-12/json-schema-core.html#name-then), and [else](https://json-schema.org/draft/2020-12/json-schema-core.html#name-else). + +Here's how the validation works in this example: If the value of `isMember` is true: * The then block is applied, which specifies that the `membershipNumber` property should be a string with a minimum length of 10 and a maximum length of 10. From b54c5a4153e0580b3621f1f7b79701c03b544603 Mon Sep 17 00:00:00 2001 From: Akanksha Kushwaha Date: Sat, 15 Jul 2023 10:20:12 +0530 Subject: [PATCH 3/7] docs: updated examples Signed-off-by: Akanksha Kushwaha --- pages/learn/miscellaneous-examples.md | 95 ++++++++++++++++++++------- 1 file changed, 71 insertions(+), 24 deletions(-) diff --git a/pages/learn/miscellaneous-examples.md b/pages/learn/miscellaneous-examples.md index c6d9eefc4..69b53cfa0 100644 --- a/pages/learn/miscellaneous-examples.md +++ b/pages/learn/miscellaneous-examples.md @@ -119,7 +119,6 @@ For the `vegetables` property: * `type` is also set to "array" to indicate it's an array. * `items` references the `$defs/veggie` definition, indicating that the items in the array should conform to the "veggie" schema defined in the `$defs` section. - ```json { "$id": "https://example.com/arrays.schema.json", @@ -180,7 +179,7 @@ The data example shows the usage of arrays. The `fruits` property contains an ar ## Enumerated values -This example introduces the `enum` validation keyword and defines an object with a property called "status" that only allows specific enumerated values: "active", "inactive", and "pending". +This example introduces the `enum` validation keyword which is used with an array of values that includes an integer (`42`), a boolean (`true`), a string (`"hello"`), `null`, and an array (`[1, 2, 3]`). This demonstrates how `enum` can be used to specify a set of allowed values of different types. ```json { @@ -189,9 +188,8 @@ This example introduces the `enum` validation keyword and defines an object with "title": "Enumerated Values", "type": "object", "properties": { - "status": { - "type": "string", - "enum": ["active", "inactive", "pending"] + "data": { + "enum": [42, true, "hello", null, [1, 2, 3]] } } } @@ -201,11 +199,11 @@ This example introduces the `enum` validation keyword and defines an object with ```json { - "status": "active" + "data": [1, 2, 3] } ``` -The provided data adheres to the schema by using the value "active" for the `status` property. +The provided data adheres to the schema by using the exact values specified in the enum array: `[1, 2, 3]`. ## Regular expression pattern @@ -305,26 +303,72 @@ The schema below represents a complex object with various properties including ` The provided data conforms to the schema by including values for the required properties and ensuring the `age` is an integer greater than or equal to zero. The `address` object contains all the necessary properties, and the `hobbies` property is an array of strings. -## Conditional validation with dependencies +## Conditional validation with dependentRequired -The schema below defines an object with two properties: `isMember` and `membershipNumber`. The `membershipNumber` property is required and must have a length of 10 characters only when the `isMember` property is set to true. +In this example, the `dependentRequired` keyword is used to specify that the property `bar` is required when the property `foo` is present. The schema enforces the condition that if `foo` exists, then `bar` must also be present. ```json { - "$id": "https://example.com/conditional-validation.schema.json", + "$id": "https://example.com/conditional-validation-dependentRequired.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Conditional Validation", + "title": "Conditional Validation with dependentRequired", "type": "object", "properties": { - "isMember": { + "foo": { "type": "boolean" }, - "membershipNumber": { - "type": "string", - "maxLength": 10, - "minLength": 10, - "dependencies": { - "isMember": true + "bar": { + "type": "string" + } + }, + "dependentRequired": { + "foo": ["bar"] + } +} +``` + +**Data** + +```json +{ + "foo": true, + "bar": "Hello World" +} +``` + +As per the schema, when the `foo` property is present (`true`), the `bar` property becomes required. The `bar` property is provided with the value "Hello World", satisfying the requirement of being a string and ensuring compliance with the `dependentRequired` condition. + + +## Conditional validation with dependentSchemas + +The given schema showcases the use of the `dependentSchemas` keyword. It allows defining a subschema that must be satisfied if a certain property is present. + +* In this example, the schema defines an object with two properties: `foo` and `propertiesCount`. The `foo` property is of boolean type, while the `propertiesCount` property is of integer type with a minimum value of 0. +* According to the subschema, when the `foo` property is present, the `propertiesCount` property becomes required, and must be an integer with a minimum value of 7. + +```json +{ + "$id": "https://example.com/conditional-validation-dependentSchemas.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Conditional Validation with dependentSchemas", + "type": "object", + "properties": { + "foo": { + "type": "boolean" + }, + "propertiesCount": { + "type": "integer", + "minimum": 0 + } + }, + "dependentSchemas": { + "foo": { + "required": ["propertiesCount"], + "properties": { + "propertiesCount": { + "type": "integer", + "minimum": 7 + } } } } @@ -335,12 +379,12 @@ The schema below defines an object with two properties: `isMember` and `membersh ```json { - "isMember": true, - "membershipNumber": "1234567890" + "foo": true, + "propertiesCount": 10 } ``` -The `dependencies` keyword is used to enforce the presence of the `membershipNumber` property when `isMember` is set to true. The provided data satisfies these conditions. +Here, the `foo` property is set to true, indicating its presence. As per the schema, when `foo` is present, the `propertiesCount` property becomes required. In this case, the `propertiesCount` property is provided with a value of 10, which satisfies the requirement of being an integer and having a minimum value of 7. ## Conditional validation with if-else @@ -369,6 +413,7 @@ If the value of `isMember` is anything other than true: "type": "string" } }, + "required": ["isMember"], "if": { "properties": { "isMember": { @@ -388,11 +433,13 @@ If the value of `isMember` is anything other than true: "else": { "properties": { "membershipNumber": { - "type": "string" + "type": "string", + "minLength": 15 } } } } + ``` **Data** @@ -409,8 +456,8 @@ In this case, the `isMember` property is set to true, so the then block is appli ```json { "isMember": false, - "membershipNumber": "ABC123" + "membershipNumber": "GUEST1234567890" } ``` -In this case, the `isMember` property is false, so the else block is applied. The `membershipNumber` property can be any string, so it satisfies the validation. \ No newline at end of file +In this case, the `isMember` property is false, so the else block is applied. The `membershipNumber` property can be any string with minimum length greater than or equal to 15, so it satisfies the validation. \ No newline at end of file From bf7a9b70a324f86fb52fc8d25fe4b4fe969ca029 Mon Sep 17 00:00:00 2001 From: Akanksha Kushwaha Date: Sun, 16 Jul 2023 17:06:29 +0530 Subject: [PATCH 4/7] docs: minor changes to the examples Signed-off-by: Akanksha Kushwaha --- pages/learn/miscellaneous-examples.md | 43 +++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/pages/learn/miscellaneous-examples.md b/pages/learn/miscellaneous-examples.md index 69b53cfa0..6ffa59848 100644 --- a/pages/learn/miscellaneous-examples.md +++ b/pages/learn/miscellaneous-examples.md @@ -314,6 +314,9 @@ In this example, the `dependentRequired` keyword is used to specify that the pro "title": "Conditional Validation with dependentRequired", "type": "object", "properties": { + "validity": { + "type": "string" + }, "foo": { "type": "boolean" }, @@ -331,6 +334,7 @@ In this example, the `dependentRequired` keyword is used to specify that the pro ```json { + "validity": "valid", "foo": true, "bar": "Hello World" } @@ -338,6 +342,23 @@ In this example, the `dependentRequired` keyword is used to specify that the pro As per the schema, when the `foo` property is present (`true`), the `bar` property becomes required. The `bar` property is provided with the value "Hello World", satisfying the requirement of being a string and ensuring compliance with the `dependentRequired` condition. +```json +{ + "validity": "valid" +} +``` + +Since both `foo` and `bar` are missing, the instance is still valid and in compliance with the `dependentRequired` condition as well. + +```json +{ + "validity": "invalid", + "foo": true +} +``` + +The above schema is invalid, since the `foo` property is present, but `bar` is not, which invalidates the condition of the `dependentRequired` keyword. + ## Conditional validation with dependentSchemas @@ -366,7 +387,6 @@ The given schema showcases the use of the `dependentSchemas` keyword. It allows "required": ["propertiesCount"], "properties": { "propertiesCount": { - "type": "integer", "minimum": 7 } } @@ -386,6 +406,23 @@ The given schema showcases the use of the `dependentSchemas` keyword. It allows Here, the `foo` property is set to true, indicating its presence. As per the schema, when `foo` is present, the `propertiesCount` property becomes required. In this case, the `propertiesCount` property is provided with a value of 10, which satisfies the requirement of being an integer and having a minimum value of 7. +```json +{ + "propertiesCount": 5 +} +``` + +In the above data, `propertiesCount` is 5 but since `foo` is missing, `propertiesCount` does not need to be 7 or more than 7, it only needs to be greater than or equal to 0. Hence, this instance is valid. + +```json +{ + "foo": true, + "propertiesCount": 5 +} +``` + +In this, we have `foo` as true, but `propertiesCount` is 5, and in the schema, `propertiesCount` is set to have minimum 7 as the input according to the `dependentSchemas`. Hence, this is an invalid instance. + ## Conditional validation with if-else @@ -394,10 +431,10 @@ In this schema, we have two properties: `isMember` and `membershipNumber`. The c Here's how the validation works in this example: If the value of `isMember` is true: -* The then block is applied, which specifies that the `membershipNumber` property should be a string with a minimum length of 10 and a maximum length of 10. +* The `then` block is applied, which specifies that the `membershipNumber` property should be a string with a minimum length of 10 and a maximum length of 10. If the value of `isMember` is anything other than true: -* The else block is applied, which specifies that the `membershipNumber` property can be any string. +* The `else` block is applied, which specifies that the `membershipNumber` property can be any string. ```json { From 46934fb9fbbbe813eeee413558645722efa00e45 Mon Sep 17 00:00:00 2001 From: Akanksha Kushwaha Date: Tue, 18 Jul 2023 11:06:50 +0530 Subject: [PATCH 5/7] docs: removed a property from an example Signed-off-by: Akanksha Kushwaha --- pages/learn/miscellaneous-examples.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pages/learn/miscellaneous-examples.md b/pages/learn/miscellaneous-examples.md index 6ffa59848..5475ad1ab 100644 --- a/pages/learn/miscellaneous-examples.md +++ b/pages/learn/miscellaneous-examples.md @@ -314,9 +314,6 @@ In this example, the `dependentRequired` keyword is used to specify that the pro "title": "Conditional Validation with dependentRequired", "type": "object", "properties": { - "validity": { - "type": "string" - }, "foo": { "type": "boolean" }, @@ -334,7 +331,6 @@ In this example, the `dependentRequired` keyword is used to specify that the pro ```json { - "validity": "valid", "foo": true, "bar": "Hello World" } @@ -344,7 +340,6 @@ As per the schema, when the `foo` property is present (`true`), the `bar` proper ```json { - "validity": "valid" } ``` @@ -352,7 +347,6 @@ Since both `foo` and `bar` are missing, the instance is still valid and in compl ```json { - "validity": "invalid", "foo": true } ``` From b57e33bf3ad10dd56e7c3425d9dd80d45d125325 Mon Sep 17 00:00:00 2001 From: Akanksha Kushwaha Date: Wed, 19 Jul 2023 18:05:40 +0530 Subject: [PATCH 6/7] docs: add index section for better understanding Signed-off-by: Akanksha Kushwaha --- pages/learn/miscellaneous-examples.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pages/learn/miscellaneous-examples.md b/pages/learn/miscellaneous-examples.md index 5475ad1ab..aa935138b 100644 --- a/pages/learn/miscellaneous-examples.md +++ b/pages/learn/miscellaneous-examples.md @@ -3,6 +3,18 @@ section: docs title: Miscellaneous Examples --- +In this page, you will find examples illustrating different uses cases to help you get the most out of your JSON Schemas, including: + +- [A typical minimum schema](/learn/miscellaneous-examples/#basic) +- [Describing geographical coordinates](/learn/miscellaneous-examples/#describing-geographical-coordinates) +- [Arrays of things](/learn/miscellaneous-examples/#arrays-of-things) +- [Enumerated values](/learn/miscellaneous-examples/#enumerated-values) +- [Regular expression pattern](/learn/miscellaneous-examples/#regular-expression-pattern) +- [Complex object with nested properties](/learn/miscellaneous-examples/#complex-object-with-nested-properties) +- [Conditional validation with dependentRequired](/learn/miscellaneous-examples/#conditional-validation-with-dependentrequired) +- [Conditional validation with dependentSchemas](/learn/miscellaneous-examples/#conditional-validation-with-dependentschemas) +- [Conditional validation with if-else](/learn/miscellaneous-examples/#conditional-validation-with-if-else) + ## Basic This example provides a typical minimum you are likely to see in JSON Schema. It contains: From 7e6cd2e446c14925d353e0612e51e4e7d940c15b Mon Sep 17 00:00:00 2001 From: Benjamin Granados <40007659+benjagm@users.noreply.github.com> Date: Wed, 19 Jul 2023 15:10:37 +0200 Subject: [PATCH 7/7] Update miscellaneous-examples.md Fixed relative urls in the index --- pages/learn/miscellaneous-examples.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pages/learn/miscellaneous-examples.md b/pages/learn/miscellaneous-examples.md index aa935138b..28e07bb2f 100644 --- a/pages/learn/miscellaneous-examples.md +++ b/pages/learn/miscellaneous-examples.md @@ -5,15 +5,15 @@ title: Miscellaneous Examples In this page, you will find examples illustrating different uses cases to help you get the most out of your JSON Schemas, including: -- [A typical minimum schema](/learn/miscellaneous-examples/#basic) -- [Describing geographical coordinates](/learn/miscellaneous-examples/#describing-geographical-coordinates) -- [Arrays of things](/learn/miscellaneous-examples/#arrays-of-things) -- [Enumerated values](/learn/miscellaneous-examples/#enumerated-values) -- [Regular expression pattern](/learn/miscellaneous-examples/#regular-expression-pattern) -- [Complex object with nested properties](/learn/miscellaneous-examples/#complex-object-with-nested-properties) -- [Conditional validation with dependentRequired](/learn/miscellaneous-examples/#conditional-validation-with-dependentrequired) -- [Conditional validation with dependentSchemas](/learn/miscellaneous-examples/#conditional-validation-with-dependentschemas) -- [Conditional validation with if-else](/learn/miscellaneous-examples/#conditional-validation-with-if-else) +- [A typical minimum schema](#basic) +- [Describing geographical coordinates](#describing-geographical-coordinates) +- [Arrays of things](#arrays-of-things) +- [Enumerated values](#enumerated-values) +- [Regular expression pattern](#regular-expression-pattern) +- [Complex object with nested properties](#complex-object-with-nested-properties) +- [Conditional validation with dependentRequired](#conditional-validation-with-dependentrequired) +- [Conditional validation with dependentSchemas](#conditional-validation-with-dependentschemas) +- [Conditional validation with if-else](#conditional-validation-with-if-else) ## Basic @@ -503,4 +503,4 @@ In this case, the `isMember` property is set to true, so the then block is appli } ``` -In this case, the `isMember` property is false, so the else block is applied. The `membershipNumber` property can be any string with minimum length greater than or equal to 15, so it satisfies the validation. \ No newline at end of file +In this case, the `isMember` property is false, so the else block is applied. The `membershipNumber` property can be any string with minimum length greater than or equal to 15, so it satisfies the validation.