You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These types have analogs in most programming languages, though they may
26
25
go by different names.
27
26
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
+
28
30
[tabs-start "Language-specific info"]
29
31
30
32
[tab "Python"]
@@ -127,7 +129,7 @@ to decode ``Int`` from a non-integer number in JSON.
127
129
128
130
The `type` keyword can take two forms:
129
131
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.
131
133
132
134
Here is an example of using `"number"` as a single string value:
133
135
@@ -176,7 +178,7 @@ JSON Schema offers a variety of keywords to validate data against specific types
176
178
| Type Keyword | Specific Keywords | Description |
|[string](../../understanding-json-schema/reference/string)|`minLength`, `maxLength`, `pattern`, `format`| Restrict string length, pattern matching, and format validation (e.g., email, date). |
182
184
@@ -206,7 +208,7 @@ The JSON Schema specification has a bias toward networking-related formats due t
206
208
207
209
### Built-in Formats
208
210
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.
0 commit comments