swagger-2.0

Return an array of object in Swaggerhub

徘徊边缘 提交于 2019-11-26 06:07:54
问题 I am defining an API specification in swaggerhub. The /contacts request returns an array of contacts. The definition is below: /contacts: get: tags: - contacts summary: Get all the contacts description: This displays all the contacts present for the user. operationId: getContact produces: - application/json - application/xml responses: 200: description: successful operation schema: $ref: \'#/definitions/AllContacts\' 400: description: Invalid id supplied 404: description: Contact not found

Swagger UI - “ TypeError: Failed to fetch” on valid response

依然范特西╮ 提交于 2019-11-25 15:19:07
I've just pulled down the latest Swagger from the Git repo (3.0.19) using: https://github.com/swagger-api/swagger-ui.git and updated my API to use the new version. Ran git describe --tags to confirm and my version is currently: v3.0.19-6-gaab1403 The problem I'm having is one described here , whereby my response is a 403 (I can see this in the inspector on the browser) and although I have a reponse for error 403, I still get the TypeError: Failed to fetch message. Here's a snippet from my definition regarding the 403 response: "403": { "description": "Forbidden", "headers": { "Access-Control