Skip to content

Instantly share code, notes, and snippets.

@goravseth
Last active May 29, 2020 02:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goravseth/ac6190d6377dad7e16ad3a125dda6160 to your computer and use it in GitHub Desktop.
Save goravseth/ac6190d6377dad7e16ad3a125dda6160 to your computer and use it in GitHub Desktop.
adding response schema
{
"swagger": "2.0",
"info": {
"title": "Sample API",
"description": "API description in Markdown.",
"version": "1.0.0"
},
"paths": {
"/": {
"post": {
"summary": "sends the id.",
"consumes": [
"application/json"
],
"produces":[
"application/json"
],
"parameters": [
{
"in": "body",
"name": "id",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"202": {
"description": "Success!",
"headers": {
"status" : {
"type" : "string"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
]
}
}
}
@goravseth
Copy link
Author

this is what it returns on error, need to add that for 40x
{
"error": {
"code": "DirectApiAuthorizationRequired",
"message": "The request must be authenticated only by Shared Access scheme."
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment