Skip to content

Instantly share code, notes, and snippets.

@JonDotsoy
Last active July 3, 2019 00:21
Show Gist options
  • Save JonDotsoy/63620a11729ba2711d86384028e786cb to your computer and use it in GitHub Desktop.
Save JonDotsoy/63620a11729ba2711d86384028e786cb to your computer and use it in GitHub Desktop.
{
"$schema": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v3.0/schema.json#",
"info": {
"title": "Http Error Schema",
"version": "1.0.0"
},
"components": {
"schemas": {
"Error": {
"description": "Object Error",
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"message",
"statusCode"
],
"properties": {
"name": {
"type": "string",
"description": "Name error"
},
"message": {
"type": "string",
"description": "the traditional error message, which should be kept short and all single line"
},
"statusCode": {
"type": "string",
"description": "the status code of the error, defaulting to `500`"
},
"status": {
"type": "string",
"description": "the status code of the error, mirroring `statusCode` for general compatibility",
"nullable": true
},
"meta": {
"type": "object",
"description": "can be an object of header names to values to be sent to the client, defaulting to `undefined`. When defined, the key names should all be lower-cased",
"nullable": true
},
"stack": {
"type": "string",
"description": "In debug mode is used to print the stack error. This always is `undefined` in production",
"nullable": true
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment