JSON Schemahttp://json-schema.org
w ͋ΔJSONͷߏΛنఆ͢Δʢͭ·ΓεΩʔϚʣJSON
type: object
properties:
id:
type: string
email:
type: string
role:
type: array
items:
type: string
enum:
- admin
- normal
// όϦσʔγϣϯOK
{
"id": "1",
"email": "
[email protected]",
"role": "normal"
}
// όϦσʔγϣϯNGʢid͕integerʣ
{
"id": 1
"email": "
[email protected]"
}
id, email, roleΛଐੑʹ࣋ͭJSON Schema JSONʹର͢ΔόϦσʔγϣϯ͕Մೳ