Skip to content

Commit 7db6856

Browse files
chores
1 parent 02a60ee commit 7db6856

File tree

1 file changed

+7
-5
lines changed
  • pages/understanding-json-schema/reference

1 file changed

+7
-5
lines changed

pages/understanding-json-schema/reference/type.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ At its core, JSON Schema defines the following basic types:
1616
- [array](../../understanding-json-schema/reference/array)
1717
- [boolean](../../understanding-json-schema/reference/boolean)
1818
- [null](../../understanding-json-schema/reference/null)
19-
- [numeric types](../../understanding-json-schema/reference/numeric)
19+
- [number](../../understanding-json-schema/reference/numeric)
2020
- [object](../../understanding-json-schema/reference/object)
21-
- [regular expressions](../../understanding-json-schema/reference/regular_expressions)
2221
- [string](../../understanding-json-schema/reference/string)
2322

2423

2524
These types have analogs in most programming languages, though they may
2625
go by different names.
2726

27+
> 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.
28+
29+
2830
[tabs-start "Language-specific info"]
2931

3032
[tab "Python"]
@@ -127,7 +129,7 @@ to decode ``Int`` from a non-integer number in JSON.
127129

128130
The `type` keyword can take two forms:
129131

130-
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.
132+
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.
131133

132134
Here is an example of using `"number"` as a single string value:
133135

@@ -176,7 +178,7 @@ JSON Schema offers a variety of keywords to validate data against specific types
176178
| Type Keyword | Specific Keywords | Description |
177179
|---|---|---|
178180
| [array](../../understanding-json-schema/reference/array) | `items`, `additionalItems`, `minItems`, `maxItems`, `uniqueItems` | Define item schemas, additional item handling, item count constraints, and uniqueness. |
179-
| [number](../../understanding-json-schema/reference/numeric) | `minimum`, `maximum`, `exclusiveMinimum`, `exclusiveMaximum`, `multipleOf` | Define numeric ranges, including exclusive bounds and divisibility. |
181+
| [number](../../understanding-json-schema/reference/numeric) | `minimum`, `maximum`, `exclusiveMinimum`, `exclusiveMaximum`, `multipleOf` | Define numeric ranges and allowed increments. |
180182
| [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. |
181183
| [string](../../understanding-json-schema/reference/string) | `minLength`, `maxLength`, `pattern`, `format`| Restrict string length, pattern matching, and format validation (e.g., email, date). |
182184

@@ -206,7 +208,7 @@ The JSON Schema specification has a bias toward networking-related formats due t
206208

207209
### Built-in Formats
208210

209-
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.
211+
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.
210212

211213
#### Dates and Times
212214

0 commit comments

Comments
 (0)