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

Parse required query params only

Open rajesh-k-g opened this issue 2 years ago • 2 comments

Add query param only if the parameter object has required: true

rajesh-k-g avatar Jun 02 '22 13:06 rajesh-k-g

@ErikWittern,

By default, the query params listed in the parameters object are appended to url even if it is not a required field. Instead of this can we append only required query param (i.e required: true) to the code snippets ?

Swagger also follows this approach for generating code snippets.

image

@ErikWittern please share your thoughts.

rajesh-k-g avatar Jun 03 '22 06:06 rajesh-k-g

Oh, I like the idea of this PR. We have a few operations with really long example URLs

michaelgwelch avatar Jul 25 '22 22:07 michaelgwelch