ErikWittern / openapi-snippet

Generates code snippets for given Swagger / Open API documents
MIT License
115 stars 66 forks source link

Parse required query params only #87

Open rajesh-k-g opened 2 years ago

rajesh-k-g commented 2 years ago

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

rajesh-k-g commented 2 years ago

@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.

michaelgwelch commented 2 years ago

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