Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pranaysharma995 opened this issue Jan 13, 2021 · 1 comment

Comments

@pranaysharma995
Copy link

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"
 *       
*/


@mathis-m
Copy link
Contributor

The swagger snippet you posted has several validation issues.
Since you are using some customized version of swagger-ui try to reproduce your issue with https://editor.swagger.io/.

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

No branches or pull requests

3 participants