openapi-to-postman icon indicating copy to clipboard operation
openapi-to-postman copied to clipboard

Config to disable params by default

Open drjonnicholson opened this issue 6 years ago • 17 comments

It'd be nice if the collection disables params, and certain headers, by default.

Ideally, the initial state of the converted collection should disable any optional things, and enable any required things.

drjonnicholson avatar Feb 20 '19 10:02 drjonnicholson

@drjonnicholson Are you talking about any parameters that don't have required: true being added to the request/collection, but in the disabled state?

abhijitkane avatar Aug 16 '19 07:08 abhijitkane

Yep. I think the most common use of an endpoint is to have no parameters provided (except for required ones). It would highlight which things are necessary to hit an endpoint and reduce time from import to use (in some cases we had something like 10 parameters to disable, all being optional, plus some optional headers)

drjonnicholson avatar Sep 29 '19 19:09 drjonnicholson

@abhijitkane even if they are declared as required: false the result is the parameter enabled by default in Postman. This would be a very welcome enhacement.

menecio avatar Oct 10 '19 09:10 menecio

This can be provided behind an option disableOptionalParameters. When set to true, the collection imported in postman will have all optional parameters(not marked as required: true) in the disabled state.

shreys7 avatar Feb 24 '20 09:02 shreys7

@shreys7

I tried this option but I dont see any difference in my postman Collection that is generated? Is this option available?

If I debug the "options" in the library, I only get the following:

{
  "requestNameSource": "Fallback",
  "indentCharacter": "Space",
  "collapseFolders": true,
  "requestParametersResolution": "Example",
  "exampleParametersResolution": "Example",
  "folderStrategy": "Tags",
  "schemaFaker": true,
  "shortValidationErrors": false,
  "validationPropertiesToIgnore": [],
  "showMissingInSchemaErrors": true,
  "detailedBlobValidation": false
}

thim81 avatar Jun 05 '20 15:06 thim81

@thim81 Yes, This option is not available yet. We will be picking this up soon.

VShingala avatar Sep 28 '20 13:09 VShingala

@abhijitkane is this feature added if not i could try

mdaj06 avatar Oct 15 '20 21:10 mdaj06

Following this case, as I would love to have this feature added when possible. The API I am developing has quite a lot of optional parameters for each endpoint, and having them disabled by default would vastly lighten the burden on consumers.

RJSkywalker91 avatar Jan 26 '21 22:01 RJSkywalker91

+1

jeansoonsik avatar Feb 25 '21 18:02 jeansoonsik

+1, having to disable them all manually is a lot of effort for big APIs

gmcquistin avatar Mar 13 '21 07:03 gmcquistin

Hi everyone, we have introduced a new option Disable optional parameters. When set to ON, it will make sure only required parameters are enabled. You should find it under the Show advanced settings dropdown menu.

Try it out and feel free to add any feedback on this thread.

Screenshot 2021-03-16 at 3 49 51 PM

VShingala avatar Mar 16 '21 10:03 VShingala

Awesome, thanks guys for your work on this! 🎉

gmcquistin avatar Mar 16 '21 10:03 gmcquistin

@VShingala What's the equivalent option for this library?

rohit-gohri avatar Mar 16 '21 10:03 rohit-gohri

@rohit-gohri You can find all documentation regarding option here. For using it in CLI you can useid field mentioned in there (which is disableOptionalParameters for this option).

VShingala avatar Mar 16 '21 10:03 VShingala

Hi everyone, we have introduced a new option Disable optional parameters. When set to ON, it will make sure only required parameters are enabled. You should find it under the Show advanced settings dropdown menu.

Try it out and feel free to add any feedback on this thread.

Screenshot 2021-03-16 at 3 49 51 PM

Hi! Im not able to see this option anymore (I would say that I was able to see it some time ago...). There has been any update changing this?

image

kevinv21 avatar Mar 23 '23 14:03 kevinv21

Yes, we either need to reopen this issue or create a new one, since that option has apparently been removed.

lb-wilson avatar Mar 27 '23 23:03 lb-wilson

@kevinv21 @lb-wilson It seems this option has been removed due to some regression with App v10.12. We're working on fixing this, meanwhile, as a workaround, you can use this module via CLI to generate the collection.

You can find the documentation for this here: https://github.com/postmanlabs/openapi-to-postman#usage. Use enableOptionalParameters=true along with other options as required.

VShingala avatar Mar 28 '23 13:03 VShingala