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, ∼2085🔥, 0💬
Popular Posts:
How To Read the Entire File into a Single String in PHP? If you have a file, and you want to read th...
How to use the "@(...)" expression in Azure API Policy? The "@(...)" expression in Azure API Policy ...
How to use .NET CLR Types in Azure API Policy? By default, Azure imports many basic .NET CLR (Common...
How To Read a File in Binary Mode in PHP? If you have a file that stores binary data, like an execut...
How To Move Uploaded Files To Permanent Directory in PHP? PHP stores uploaded files in a temporary d...