Closed JoeCarlson closed 4 years ago
Is there a mechanism for optional query parameters in swagger-test?
I can't remember, but that's a great idea. I'll take a look and see if/how that might be supported.
You're right; this isn't supported by the current version of swagger-test. #25 is a start at adding support.
Optional query parameters in declared x-amples are now supported by swagger-test 0.8.0. Here's an example: https://github.com/earldouglas/swagger-test/blob/0.8.0/test/swagger.json#L34
A follow-up will add support for optional query parameters in inferred x-amples.
This is working for me. Thanks for the update.
Thank you for providing swagger-test. I had a problem with optional query parameters. I don't know if this is an issue of me not understanding x-amples well enough or a request for a new feature. My endpoint is
/api/call/{id}
withI'd like to execute my tests with and without option1. I hoped that an x-amples entry: request:
would have generated
?option1=10
to the URL. But this is not the case and I don't see a mechanism for adding query parameters in url-template.js. Is there a mechanism for optional query parameters in swagger-test?