postmanlabs / swagger2-to-postman

Converter for swagger 2.0 JSON to Postman Collection
Apache License 2.0
120 stars 56 forks source link

remove verbose query params from path, like: {?paramA,paramB} #43

Open Bancalets opened 5 years ago

Bancalets commented 5 years ago

Spring swagger2 exported path values create entries like this one:

"/activity/{user}{?from,to}"

The result is a non importable json entry for Postman, as the Query Params (optional or not) are set twice, the second time with the right format, following the previous example:

"url": "{{scheme}}://{{host}}:{{port}}/service/activity/:user:?from,to?from={{from}}&to={{to}}",

The fix prevents this malformed entry and transforms it to: "url": "{{scheme}}://{{host}}:{{port}}/service/activity/:user?from={{from}}&to={{to}}",

What is a valid entry and works fine with Postman JSON Import