JSON Schema View Demo
Code in GitHub
Live Schema
Edit the schema
Result
Person
{
name:
string
}
Simple
JSON Schema
Object
title:
"Name"
description:
"A name"
type:
"string"
Result
Name
string
A name
Object
JSON Schema
Object
type:
"object"
title:
"Person"
description:
"A simple person object"
properties:
Object
name:
Object
type:
"string"
name:
"name"
age:
Object
type:
"integer"
name:
"age"
Result
Person
{
A simple person object
age:
integer
name:
string
}
Array
JSON Schema
Object
type:
"array"
title:
"Names"
description:
"An array of names"
items:
Object
type:
"string"
Result
Names
[
An array of names
string
]
Primitive Enum
JSON Schema
Object
description:
"This string can only be one of predefined values"
type:
"string"
enum:
Array
[
3
]
0:
"one"
1:
"two"
2:
"three"
Result
string
This string can only be one of predefined values
Enum:
Array
[
3
]
0:
"one"
1:
"two"
2:
"three"
Object Enum
JSON Schema
Object
description:
"Car can only be one of two available options"
type:
"object"
title:
"Car"
properties:
Object
make:
Object
type:
"string"
name:
"make"
model:
Object
type:
"string"
name:
"model"
enum:
Array
[
2
]
0:
Object
make:
"Toyota"
model:
"Camry"
1:
Object
make:
"Nissan"
model:
"Rouge"
Result
Car
{
Car can only be one of two available options
make:
string
model:
string
Enum:
Array
[
2
]
0:
Object
1:
Object
}
Array Enum
JSON Schema
Object
description:
"ways to count 10 items"
title:
"Numbers"
type:
"array"
maxItems:
10
minItems:
10
items:
Object
type:
"string"
enum:
Array
[
2
]
0:
Array
[
10
]
0:
"one"
1:
"two"
2:
"three"
3:
"four"
4:
"five"
5:
"six"
6:
"seven"
7:
"eight"
8:
"nine"
9:
"ten"
1:
Array
[
10
]
0:
"alpha"
1:
"beta"
2:
"gamma"
3:
"delta"
4:
"epsilon"
5:
"zeta"
6:
"eta"
7:
"theta"
8:
"iota"
9:
"kappa"
Result
Numbers
[
(10..10)
ways to count 10 items
string
Enum:
Array
[
2
]
0:
Array
[
10
]
1:
Array
[
10
]
]
Required
JSON Schema
Object
properties:
Object
accountNumber:
Object
type:
"integer"
name:
"accountNumber"
required:
Array
[
1
]
0:
"accountNumber"
Result
{
accountNumber:
integer
*
}
Title and Description
JSON Schema
Object
title:
"Person"
description:
"A person schema that has name and age fields"
properties:
Object
name:
Object
type:
"string"
name:
"name"
age:
Object
type:
"integer"
name:
"age"
Result
Person
{
A person schema that has name and age fields
age:
integer
name:
string
}
Format, Minimum, Maximum, MinLength, and MaxLength
JSON Schema
Object
properties:
Object
accountNumber:
Object
type:
"integer"
format:
"int64"
minimum:
400000
maximum:
900000
name:
"accountNumber"
bankName:
Object
type:
"string"
minLength:
5
maxLength:
100
name:
"bankName"
required:
Array
[
1
]
0:
"accountNumber"
Result
{
accountNumber:
integer
*
(int64)
minimum:400000
maximum:900000
bankName:
string
minLength:5
maxLength:100
}
Nested Array and Objects
JSON Schema
Object
description:
"A teacher"
properties:
Object
name:
Object
type:
"string"
name:
"name"
students:
Object
type:
"array"
items:
Object
name:
"students"
classes:
Object
type:
"array"
items:
Object
name:
"classes"
Result
{
A teacher
classes:
[
{
}
id:
integer
name:
string
]
name:
string
students:
[
integer
]
}
Deep
JSON Schema
Object
title:
"Level 1"
properties:
Object
child:
Object
title:
"Level 2"
properties:
Object
name:
"child"
Result
Level 1
{
child:
Level 2
{
child:
Level 3
{
}
child:
Level 4
{
}
value:
string
}
}
Complex
JSON Schema
Object
title:
"Person"
description:
"A person in our database"
type:
"object"
properties:
Object
name:
Object
type:
"string"
name:
"name"
age:
Object
type:
"integer"
format:
"int64"
minimum:
0
name:
"age"
email:
Object
type:
"string"
name:
"email"
single:
Object
type:
"boolean"
name:
"single"
school:
Object
type:
"object"
title:
"School"
description:
"A School"
properties:
Object
required:
Array
[
1
]
name:
"school"
interests:
Object
type:
"array"
items:
Object
name:
"interests"
required:
Array
[
2
]
0:
"name"
1:
"age"
Result
Person
{
A person in our database
age:
integer
*
(int64)
email:
string
interests:
[
Interest
{
}
An interest
name:
string
*
]
name:
string
*
school:
School
{
A School
district:
string
name:
string
*
}
single:
boolean
}
Complex Array
JSON Schema
Object
title:
"ComplexArray"
type:
"array"
minItems:
1
maxItems:
100
uniqueItems:
true
items:
Object
type:
"string"
Result
ComplexArray
[
(1..100)
♦
string
]
allOf
JSON Schema
Object
title:
"Student"
type:
"object"
allOf:
Array
[
2
]
0:
Object
title:
"Person"
type:
"object"
properties:
Object
$$hashKey:
"0MO"
1:
Object
title:
"Scrabble"
type:
"object"
properties:
Object
$$hashKey:
"0MP"
Result
Student
{
all of:
Person
{
name:
string
}
Scrabble
{
score:
number
}
}
oneOf
JSON Schema
Object
title:
"BloodType"
type:
"object"
oneOf:
Array
[
2
]
0:
Object
type:
"object"
title:
"BloodType"
description:
"Blood type with structured group and RhD"
properties:
Object
$$hashKey:
"0NS"
1:
Object
type:
"string"
description:
"Blood type in a string"
enum:
Array
[
10
]
$$hashKey:
"0NT"
Result
BloodType
{
one of:
BloodType
{
Blood type with structured group and RhD
RhD:
string
group:
string
}
string
Blood type in a string
Enum:
Array
[
10
]
}
anyOf
JSON Schema
Object
title:
"Name"
anyOf:
Array
[
2
]
0:
Object
type:
"object"
properties:
Object
$$hashKey:
"0OS"
1:
Object
description:
"Full name"
type:
"string"
$$hashKey:
"0OT"
Result
Name
any of:
{
firstName:
string
lastName:
string
}
string
Full name