View source code

An online, interactive JSON Schema validator. Supports JSON Schema Draft 3, Draft 4, Draft 6, Draft 7, Draft 2019-09 and Draft 2020-12.


113
 
1
{
2
  "$schema": "https://json-schema.org/draft/2019-09/schema",
3
  "description": "Chinook customer model.",
4
  "type": "object",
5
  "x-examples": {
6
    "example-1": {
7
      "data": {
8
        "type": "customers",
9
        "id": "1",
10
        "attributes": {
11
          "firstName": "Luís",
12
          "lastName": "Gonçalves",
13
          "company": "Embraer - Empresa Brasileira de Aeronáutica S.A.",
14
          "address": "Av. Brigadeiro Faria Lima, 2170",
15
          "city": "São José dos Campos",
16
          "state": "SP",
17
          "country": "Brazil",
18
          "postalCode": "12227-000",
19
          "phone": "+55 (12) 3923-5555",
20
          "fax": "+55 (12) 3923-5566",
21
          "email": "luisg@embraer.com.br"
22
        }
23
      }
24
    }
25
  },
26
  "properties": {
27
    "data": {
28
      "type": "object",
29
      "required": [
30
        "type",
31
        "attributes"
32
      ],
33
      "properties": {
34
        "type": {
35
          "type": "string",
36
          "minLength": 1
37
        },
38
        "attributes": {
39
          "type": "object",
40
          "required": [
41
            "firstName",
42
            "lastName",
43
            "email"
44
          ],
45
          "properties": {
46
            "firstName": {
47
              "type": "string",
48
              "minLength": 1,
49
              "maxLength": 40
50
            },
51
            "lastName": {
52
              "type": "string",
53
              "minLength": 1,
54
              "maxLength": 20
55
            },
56
            "company": {
57
              "type": "string",
58
              "minLength": 1,
59
              "maxLength": 80
60
            },
61
            "address": {
62
              "type": "string",
63
              "minLength": 1,
64
              "maxLength": 70
65
            },
66
            "city": {
67
              "type": "string",
68
              "minLength": 1,
69
              "maxLength": 40
70
            },
71
            "state": {
72
              "type": "string",
73
              "minLength": 1,
74
              "maxLength": 40
75
            },
76
            "country": {
77
              "type": "string",
78
              "minLength": 1,
79
              "maxLength": 40
80
            },
81
            "postalCode": {
82
              "type": "string",
83
              "minLength": 1,
84
              "maxLength": 10
85
            },
86
            "phone": {
87
              "type": "string",
88
              "minLength": 1,
89
              "maxLength": 24
90
            },
91
            "fax": {
92
              "type": "string",
93
              "minLength": 1,
94
              "maxLength": 24
95
            },
96
            "email": {
97
              "type": "string",
98
              "minLength": 1,
99
              "pattern": "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$",
100
              "maxLength": 60,
101
              "format": "email",
102
              "example": "yunier@hey.com"
103
            }
104
          }
105
        }
106
      },
107
      "additionalProperties": false
108
    }
109
  },
110
  "required": [
111
    "data"
112
  ]
113
}
19
 
1
{
2
      "data": {
3
        "type": "customers",
4
        "id": "1",
5
        "attributes": {
6
          "firstName": "Luís",
7
          "lastName": "Gonçalves",
8
          "company": "Embraer - Empresa Brasileira de Aeronáutica S.A.",
9
          "address": "Av. Brigadeiro Faria Lima, 2170",
10
          "city": "São José dos Campos",
11
          "state": "SP",
12
          "country": "Brazil",
13
          "postalCode": "12227-000",
14
          "phone": "+55 (12) 3923-5555",
15
          "fax": "+55 (12) 3923-5566",
16
          "email": "luisg@embraer.com.br"
17
        }
18
      }
19
    }