From c047695072d32985e0da437ad188f13020d09694 Mon Sep 17 00:00:00 2001 From: DivyanshuVorrtex Date: Sun, 23 Nov 2025 20:11:48 +0000 Subject: [PATCH 1/4] chores --- pages/understanding-json-schema/reference/type.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/understanding-json-schema/reference/type.md b/pages/understanding-json-schema/reference/type.md index acce0d971..d22f5bead 100644 --- a/pages/understanding-json-schema/reference/type.md +++ b/pages/understanding-json-schema/reference/type.md @@ -72,7 +72,7 @@ floating-point. [tab "Perl"] The following table maps from the names of JSON types to -their analogous types in Objective-C: +their analogous types in Perl: | JSON | Perl | |---------|--------------------------------------------------| @@ -85,7 +85,7 @@ their analogous types in Objective-C: [tab "Objective-C"] -The following table maps from the names of JavaScript types to +The following table maps from the names of JSON types to their analogous types in Objective-C: | JSON | Objective-C | @@ -105,7 +105,7 @@ value for identity (pointer equality) to `@YES` and `@NO` constants. [tab "Swift"] -The following table maps from the names of JavaScript types to +The following table maps from the names of JSON types to their analogous types in Swift: | JSON | Swift | @@ -129,7 +129,7 @@ The `type` keyword can take two forms: 1. **A single string**. When it is a single string, it must be one of the types mentioned above (`array`, `boolean`, `integer`, `number`, `null`, `object`, `regular expressions`, or `string`). This specifies that the instance data is only valid when it matches that specific type. -Here is an example of using the `string` keyword as a single string: +Here is an example of using the `number` keyword as a single string: ```json // props { "isSchema": true } From 02a60eedbb0fe012a4f56cdafdf5fa627f329179 Mon Sep 17 00:00:00 2001 From: DivyanshuVorrtex Date: Mon, 24 Nov 2025 19:06:33 +0000 Subject: [PATCH 2/4] chores --- pages/understanding-json-schema/reference/type.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/understanding-json-schema/reference/type.md b/pages/understanding-json-schema/reference/type.md index d22f5bead..467a291b4 100644 --- a/pages/understanding-json-schema/reference/type.md +++ b/pages/understanding-json-schema/reference/type.md @@ -129,7 +129,7 @@ The `type` keyword can take two forms: 1. **A single string**. When it is a single string, it must be one of the types mentioned above (`array`, `boolean`, `integer`, `number`, `null`, `object`, `regular expressions`, or `string`). This specifies that the instance data is only valid when it matches that specific type. -Here is an example of using the `number` keyword as a single string: +Here is an example of using `"number"` as a single string value: ```json // props { "isSchema": true } From 7db6856e3e925efa0b18fa0f4b5af0065beac28a Mon Sep 17 00:00:00 2001 From: DivyanshuVorrtex Date: Wed, 26 Nov 2025 06:49:29 +0000 Subject: [PATCH 3/4] chores --- pages/understanding-json-schema/reference/type.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pages/understanding-json-schema/reference/type.md b/pages/understanding-json-schema/reference/type.md index 467a291b4..77848cfc9 100644 --- a/pages/understanding-json-schema/reference/type.md +++ b/pages/understanding-json-schema/reference/type.md @@ -16,15 +16,17 @@ At its core, JSON Schema defines the following basic types: - [array](../../understanding-json-schema/reference/array) - [boolean](../../understanding-json-schema/reference/boolean) - [null](../../understanding-json-schema/reference/null) -- [numeric types](../../understanding-json-schema/reference/numeric) +- [number](../../understanding-json-schema/reference/numeric) - [object](../../understanding-json-schema/reference/object) -- [regular expressions](../../understanding-json-schema/reference/regular_expressions) - [string](../../understanding-json-schema/reference/string) These types have analogs in most programming languages, though they may go by different names. +> Note: JSON does not define an `integer` type. In JSON Schema, `"integer"` is shorthand for `"number"` with `"multipleOf": 1`, used to represent whole-number numeric values. + + [tabs-start "Language-specific info"] [tab "Python"] @@ -127,7 +129,7 @@ to decode ``Int`` from a non-integer number in JSON. The `type` keyword can take two forms: -1. **A single string**. When it is a single string, it must be one of the types mentioned above (`array`, `boolean`, `integer`, `number`, `null`, `object`, `regular expressions`, or `string`). This specifies that the instance data is only valid when it matches that specific type. +1. **A single string**. When it is a single string, it must be one of the types mentioned above (`array`, `boolean` , `number`, `null`, `object` or `string`). This specifies that the instance data is only valid when it matches that specific type. Here is an example of using `"number"` as a single string value: @@ -176,7 +178,7 @@ JSON Schema offers a variety of keywords to validate data against specific types | Type Keyword | Specific Keywords | Description | |---|---|---| | [array](../../understanding-json-schema/reference/array) | `items`, `additionalItems`, `minItems`, `maxItems`, `uniqueItems` | Define item schemas, additional item handling, item count constraints, and uniqueness. | -| [number](../../understanding-json-schema/reference/numeric) | `minimum`, `maximum`, `exclusiveMinimum`, `exclusiveMaximum`, `multipleOf` | Define numeric ranges, including exclusive bounds and divisibility. | +| [number](../../understanding-json-schema/reference/numeric) | `minimum`, `maximum`, `exclusiveMinimum`, `exclusiveMaximum`, `multipleOf` | Define numeric ranges and allowed increments. | | [object](../../understanding-json-schema/reference/object) | `required`, `properties`, `additionalProperties`, `patternProperties`, `minProperties`, `maxProperties`, `dependencies` | Define required properties, property schemas, additional property handling, pattern-based property matching, and property count constraints. | | [string](../../understanding-json-schema/reference/string) | `minLength`, `maxLength`, `pattern`, `format`| Restrict string length, pattern matching, and format validation (e.g., email, date). | @@ -206,7 +208,7 @@ The JSON Schema specification has a bias toward networking-related formats due t ### Built-in Formats -It should be noted that `format` is not limited to a specific set of valid values or types. Users may define their own custom keywords including ones that work with JSON data types other than `string`, such as `number`. Below, we cover the formats specified in the JSON Schema specification. +It should be noted that `format` is not limited to a specific set of valid values or types. Users may define additional custom formats, but the built-in formats apply only to the `string` type. Below, we cover the formats defined in the JSON Schema specification. #### Dates and Times From 9e9bee807f61ebb61e72bdc9689f1de6d3d96447 Mon Sep 17 00:00:00 2001 From: DivyanshuVorrtex Date: Sat, 29 Nov 2025 07:02:28 +0000 Subject: [PATCH 4/4] chores --- pages/understanding-json-schema/reference/type.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pages/understanding-json-schema/reference/type.md b/pages/understanding-json-schema/reference/type.md index 77848cfc9..0a941d03f 100644 --- a/pages/understanding-json-schema/reference/type.md +++ b/pages/understanding-json-schema/reference/type.md @@ -11,21 +11,19 @@ next: The `type` [keyword](../../learn/glossary#keyword) is fundamental to JSON Schema because it specifies the data type that a schema should expect. -At its core, JSON Schema defines the following basic types: +The `type` keyword defines the following types: - [array](../../understanding-json-schema/reference/array) - [boolean](../../understanding-json-schema/reference/boolean) - [null](../../understanding-json-schema/reference/null) +- [integer](../../understanding-json-schema/reference/numeric) - [number](../../understanding-json-schema/reference/numeric) - [object](../../understanding-json-schema/reference/object) - [string](../../understanding-json-schema/reference/string) +> Note: JSON does not define an `integer` type. In JSON Schema, `"type": "integer"` is shorthand for `"type": "number", "multipleOf": 1`, and is used to represent whole-number numeric values. -These types have analogs in most programming languages, though they may -go by different names. - -> Note: JSON does not define an `integer` type. In JSON Schema, `"integer"` is shorthand for `"number"` with `"multipleOf": 1`, used to represent whole-number numeric values. - +These types have analogs in most programming languages, though they may go by different names. [tabs-start "Language-specific info"] @@ -129,7 +127,7 @@ to decode ``Int`` from a non-integer number in JSON. The `type` keyword can take two forms: -1. **A single string**. When it is a single string, it must be one of the types mentioned above (`array`, `boolean` , `number`, `null`, `object` or `string`). This specifies that the instance data is only valid when it matches that specific type. +1. **A single string**. When it is a single string, it must be one of the types mentioned above (`array`, `boolean`, `number`, `null`, `object` or `string`). This specifies that the instance data is only valid when it matches that specific type. Here is an example of using `"number"` as a single string value: @@ -208,7 +206,7 @@ The JSON Schema specification has a bias toward networking-related formats due t ### Built-in Formats -It should be noted that `format` is not limited to a specific set of valid values or types. Users may define additional custom formats, but the built-in formats apply only to the `string` type. Below, we cover the formats defined in the JSON Schema specification. +It should be noted that `format` is not limited to a specific set of valid values or types. Users may define their own custom formats including ones that work with JSON data types other than `string`, such as `number`. Below, we cover the formats specified in the JSON Schema specification. #### Dates and Times