Open ghost opened 9 years ago
+1 for stubbing out body parameters.
Also, important to keep in mind that in Swagger, for a particular operation object, there can be many parameters and where they are in the request is defined by the in
parameter. By the specification, the parameters object is defined as:
A list of parameters that are applicable for this operation. If a parameter is already defined at the Path Item, the new definition will override it, but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link to parameters that are defined at the Swagger Object's parameters. There can be one "body" parameter at most.
The last sentence is very important. If a parameter's in
is body, then the actual body parameters are defined in JSON Schema v4 format in the parameter's schema
.
For a reference, I've been using the swagger-js-codegen tool and have opened a PR there to parse out those body parameters.
By parsing this all out, Postman could (very intelligently) stub out body parameters, based on the type
, required
, and other fields in the schema.
@SunriseJJJ, could you include "Swagger" in the title of your issue? It took me a little while to find this issue considering only the term "contract" was used.
+1 ;) @a85
+1 for this. This and securityDefinitions is the only thing stopping me from automating the generation and publication of our API directly to a swagger collection
Any update on this?
+1. Very useful and needed feature.
+1
+1!
+1 for this. This is a very useful feature to streamline development. I am using Spring Rest Controller + Swagger UI to generate the Swagger Spec -> Import to postman -> **[Tidy up it in Postman] -> Gradle + Newman test automation. This feature can save a lot of rework / human mistake when preparing API testing in Postman
+1
+1 👍
+1
+1
+1
+1
+1
Hi!
Is there any possibilities (even in non-free version) to generate e.g. body for POST request according to my API contract? I.e. i upload my Swagger contract to Postman and it generates stubs for all requests (like it implemented for GET methods now, URL with stub parameters generated and then values of this parameters may be edited), probably in JSON format (and even converts it to other formats too!)
Can't find any information about this functionality. I think it wolud be a killer-feature if it will be possible to generate body stubs like this!