Last active
May 29, 2020 02:02
-
-
Save goravseth/ac6190d6377dad7e16ad3a125dda6160 to your computer and use it in GitHub Desktop.
adding response schema
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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."
}
}