swagger-api / swagger-api/swagger-ui
response header and body not visible even after adding the response body
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
screen-capture (16).zip
I and getting a response from API either for success or for failure but swagger doesn't even show the response header and response body. I am using the swagger-ui-express npm package inside the express project and here is my config file for swagger.
/**
* @swagger
* /sign-up:
* post:
* summary: Create a JSONPlaceholder user.
* requestBody:
* required: true
* content:
* application/json:
* schema:
* type: object
* properties:
* firstName:
* type: string
* description: The user's name.
* example: Leanne Graham
* lastName:
* type: string
* description: user last name
* example: kumar
* email:
* type: email
* description: user email
* example: kumar@bal.com
* countryCode:
* type: string
* description: user country code
* example: +1
* phoneNumber:
* type: number
* description: user phone number
* example: 9867858558
* password:
* type: string
* description: user password
* example: 5fghfhfg7hgh
* userType:
* type: string
* description: android/ios
* example: android
* responses:
* '200':
* description: "A success object"
* content:
* application/json:
* schema:
* type: object
* properties:
* data:
* type: string
* description: userid
* status:
* type: boolean
* description: true
* message:
* type: string
* description: sign up successfully
* '400':
* description: "Error"
* '201':
* description: "Created"
*
*/
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied Swagger configuration and screen capture, then reproduce the missing response header and body in the swagger-ui-express setup. No repository file or test is named; done means identifying the cause and confirming that successful and failed API responses display their headers and bodies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- express, javascript
- Domain
- api, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100