postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.83k stars 838 forks source link

FR: Ability to have Required or Optional request parameters #2847

Open jordan-wright opened 7 years ago

jordan-wright commented 7 years ago
  1. Postman Version: 4.10.3 (4.10.3)
  2. App (Chrome app or Mac app): Mac app
  3. OS details: 10.12.3 (16D32)
  4. Is the Interceptor on and enabled in the app: No
  5. Did you encounter this recently, or has this bug always been there: Always been there
  6. Expected behaviour: Having the ability to mark a request parameter as required or optional.

This is similar to #1155, but I thought it'd be worth expanding on the idea.

Many APIs have request parameters that are optional or required. It would be very beneficial to be able to mark these in such a way that the request won't be sent if the param is required and not provided.

Additionally, if a param is optional, is using a variable, and isn't provided, it could be removed.

Normally, I would handle these via the request.data object in a pre-request script, but unfortunately that object is read-only. This also makes it difficult to use variables since if an environment variable isn't provided the actual {{}} syntax is sent instead of a blank string unless I manually clear out the variable.

I'm still fairly new to Postman, so I could be missing something.

Let me know if you have any questions, and please keep up the great work on Postman!

Sylvester2003 commented 1 year ago

+1 2023

elizatlawy commented 1 year ago

@Raja-Simha - This feature is still not available when posting your API documentation as documentation and not as a Workspace.

martinezpl commented 1 year ago

I'd like this!

helderrscorreia commented 1 year ago

+1 I would like that very much too.

the-white-cat commented 12 months ago

+1

arigandores commented 11 months ago

+1

dave4jr commented 8 months ago

+1 2024

YouMixx commented 3 months ago

+1

shashankawasthi88 commented 2 months ago

Hi All,

We're actively working on this issue and would like to understand your workflow better to design the right solution. If you want to discuss this, please drop me a note at shashank.awasthi@postman.com or set up a call with me using this link.

@YouMixx @dave4jr @the-white-cat @helderrscorreia @martinezpl @elizatlawy