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, ∼2475🔥, 0💬
Popular Posts:
How to login to Azure API Management Publisher Dashboard? If you have given access permission to an ...
Where to get the detailed description of the JSON.stringify() Function in JavaScript? Here is the de...
How to use the urllib.request.Request object to build more complex HTTP request? The urllib.request....
How to add images to my EPUB books Images can be added into book content using the XHTML "img" eleme...
How to add request URL Template Parameters to my Azure API operation to make it more user friendly? ...