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
| number | scalar (NV or IV), or Math::BigNum, Math::BigInt |
81
+
| integer | scalar (IV) |
81
82
| object | reftype=HASH |
82
83
| array | reftype=ARRAY |
83
84
| boolean | scalar or JSON::PP::Boolean |
@@ -92,6 +93,7 @@ their analogous types in Objective-C:
92
93
|---------|--------------|
93
94
| string | NSString |
94
95
| number | NSNumber |
96
+
| integer | NSNumber |
95
97
| object | NSDictionary |
96
98
| array | NSArray |
97
99
| boolean | NSNumber [4]|
@@ -112,6 +114,7 @@ their analogous types in Swift:
112
114
|---------|------------|
113
115
| string | String |
114
116
| number | Int/Double [5]|
117
+
| integer | Int |
115
118
| object | Dictionary |
116
119
| array | Array |
117
120
| boolean | Bool |
@@ -127,7 +130,7 @@ to decode ``Int`` from a non-integer number in JSON.
127
130
128
131
The `type` keyword can take two forms:
129
132
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.
133
+
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` or `string`). This specifies that the instance data is only valid when it matches that specific type.
131
134
132
135
Here is an example of using `"number"` as a single string value:
133
136
@@ -178,6 +181,7 @@ JSON Schema offers a variety of keywords to validate data against specific types
|[integer](../../understanding-json-schema/reference/numeric)| Same as `number`| Integers use numeric constraints but must not contain a fractional part. |
181
185
|[string](../../understanding-json-schema/reference/string)|`minLength`, `maxLength`, `pattern`, `format`| Restrict string length, pattern matching, and format validation (e.g., email, date). |
182
186
183
187
@@ -206,7 +210,7 @@ The JSON Schema specification has a bias toward networking-related formats due t
206
210
207
211
### Built-in Formats
208
212
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.
213
+
It should be noted that `format` is not limited to a specific set of valid values or types. Users may define custom formats through vocabularies, but the built-in formats apply only to strings.
0 commit comments