JSON is built on the following data structures:
object:
{ "key1": "value1", "key2": "value2" }
array:
[ "first", "second", "third" ]
number:
42
3.1415926
string:
"This is a string"
boolean:
true
false
null:
null
JSON | Python |
---|---|
string | string |
number | int/float |
object | dict |
array | list |
boolean | bool |
null | None |
type | compatible keywords |
---|---|
string | type, minLength, maxLength, pattern |
number | type, minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf |
integer | type, minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf |
boolean | type |
null | type |
array | type, minItems, maxItems, items, uniqueItems |
object | type, properties, additionalProperties, required, minProperties, maxProperties, dependencies, patternProperties, regexp |