Tools, FAQ, Tutorials:
JSON Schema Example
Where to get a simple example of JSON Schema?
✍: FYIcenter.com
Here is simple JSON Schema example, called Person_Schema.json:
{
"title": "Person",
"type": "object",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"age": {
"description": "Age in years",
"type": "integer",
"minimum": 0
}
},
"required": ["firstName", "lastName"]
}
The above JSON schema defines the structure of JSON text strings that provide "Person" information. You can use to validate JSON text strings.
For example, the following JSON text string is valid as a "Person":
{
"firstName": "John",
"lastName": "Smith",
"age": 25
}
The following JSON text string is invalid as a "Person", because the required "firstName" and "lastName" properties are missing. And the "name" property is not allowed according to the JSON schema.
{
"name": "John Smith",
"age": 25
}
2018-02-01, ∼2494🔥, 0💬
Popular Posts:
What properties and functions are supported on requests.models.Response objects? "requests" module s...
How to search for the first match of a regular expression using re.search()? The re.search() functio...
How To Get the Minimum or Maximum Value of an Array in PHP? If you want to get the minimum or maximu...
How To Avoid the Undefined Index Error in PHP? If you don't want your PHP page to give out errors as...
Where to get a real Atom XML example? You can follow this tutorial to get a real Atom XML example: 1...