GitHub - HyperJSON/HyperJSON-Response: JSON Schema that closely resembles an HTTP Response Message but is completely decoupled from any specific application protocol, such as HTTP.
Repository navigation
HyperJSON-ResponsePublic
About
JSON Schema that closely resembles an HTTP Response Message but is completely decoupled from any specific application protocol, such as HTTP.
Resources
Readme Activity Custom propertiesStars
0 starsWatchers
1 watchingForks
0 forks Report repositoryBranches
Tags
Go to Branches page Go to Tags page
Latest commit
History
2 Commits
View commit history for this file.
Folders and files
| Name | Name | Last commit message | Last commit date |
|---|---|---|---|
| README.md | README.md | ||
| package.json | package.json | ||
| response-schema.json | response-schema.json | ||
| test.js | test.js | ||
Repository files navigation
HyperJSON Response Message
Version 0.0.1
Prerequisites
Schema
{
"$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"
]
}
Valid Samples
// minimal
{
status: {
code: '200'
}
}
// with an optional status message and body included
{
status: {
code: '200',
message: 'Success'
},
body: 'rocking'
}
About
JSON Schema that closely resembles an HTTP Response Message but is completely decoupled from any specific application protocol, such as HTTP.