swagger-api / swagger-api/swagger-ui

response header and body not visible even after adding the response body

Open
#6,830 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: support
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.