{
"$schema": "http://json-schema.org/draft-04/schema#",
"name": "HyperJSON Response Message",
"type": "object",
"properties": {
"status": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"required": [
"code"
]
}
},
"body": {
"anyOf": [{
"type": "array"
}, {
"type": "boolean"
}, {
"type": "integer"
}, {
"type": "number"
}, {
"type": "null"
}, {
"type": "object"
}, {
"type": "string"
}]
}
},
"required": [
"status"
]
}
// minimal
{
status: {
code: '200'
}
}
// with an optional status message and body included
{
status: {
code: '200',
message: 'Success'
},
body: 'rocking'
}