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, ∼2846🔥, 0💬
Popular Posts:
What is the "__init__()" class method? The "__init__()" class method is a special method that will b...
How to create a navigation file like navigation.xhtml for an EPUB 3.0 book? At least one navigation ...
How to read Atom validation errors at w3.org? If your Atom feed has errors, the Atom validator at w3...
How To Read Data from Keyboard (Standard Input) in PHP? If you want to read data from the standard i...
How to include additional claims in Azure AD v2.0 id_tokens? If you want to include additional claim...