JMU
JSON Schema
An Introduction


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu


Review
Objectives
Some Common Keywords and Allowed Values
An Example

A Schema for a Simple Person

jsonexamples/schema/person.jsonschema
        {
  "$schema": "http://json-schema.org/schema#",
  "title": "Person",
  "type": "object",
  "required": ["firstName", "lastName", "age"],
  "properties": 
  {
    "firstName":
    {
        "type": "string",
        "description": "Personal name"
    },
    "lastName": 
    {
      "type": "string",
      "description": "Family name"
    },
    "age":
    {
      "type": "number",
      "description": "Age"
    }
  } 
}
        
Some Other Keywords