npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Swagger to postman generator issue with body and path as part of request body together

Hi Team,

While working on Swagger 2.0, I am trying to send parameters in body as well as Path in a single post request. it is reflecting path parameter correctly but body parameters are missing…

Below is example of my Yaml file:

post:
operationId: TestMe
consumes:
- application/json
produces:
- application/json
parameters:
- name: GroupID
in: path
description: Unique identifier of the group.
required: true
type: integer
format: int32
- name: myExtId
in: path
description: Unique identifier of my extension.
required: true
type: string
- name: Model
in: body
description: This is for test.
type: string
required: true

NOTE: I’ve tried making all the parameter values as not-required by making required: false in every parameter but it didn’t work.

I am suspecting swagger 2.0 doesn’t allow us to send Body and Path parameters together. If my understanding is correct, is there any workaround we’ve ?

Below are more details:

Hi,

I am using visual studio code and node js terminal to generate postman collection using swagger2-postman-generator node package. while I am running the same yaml it is not showing the body parameters in postman rather displaying a message provided for body parameter. Here are the snapshot of my code:

By running the command I can see the json file generated successfully but when I opened it in postman, it is not showing any parameters in body and just showing the description, as this snapshot…