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

Typescript Axios Generator Wrap Query Params as Object

Open CagriAldemir opened this issue 3 years ago • 4 comments

Hi. I am generating an SDK using the Typescript Axios Generator SDK generator, but for the endpoints that accept query parameters, the parameters are being treated as individual parameters instead of being wrapped in an object. Is there a way to wrap these parameters in an object?

CagriAldemir avatar Jul 04 '23 13:07 CagriAldemir

Yes, please!

This would help very much with queries that have lot of optional query parameters. Not to say when their order changes. Now you can use the useSingleRequestParameter but that adds everything into one object including body, which is then too messy. Having query in one object would be best IMO, with keeping the URL params as they are, because they are by definition mandatory and their order is fixed.

Could be a flag to prevent breaking change, similarily as useSingleRequestParameter we could have useSingleQueryParameter.

SmallhillCZ avatar Jul 24 '23 18:07 SmallhillCZ

is any updates here ?

ImTemporaryHere avatar Oct 22 '24 15:10 ImTemporaryHere

it would be nice, it would behave like octokit!

joaquinjsb avatar Dec 13 '24 16:12 joaquinjsb

What I did eventually for personal use is I rewrote the template files so that now I have all parameters wrapped in their objects

https://github.com/SmallhillCZ/skeletons/tree/feature/openapi-sdk/sdk/templates

SmallhillCZ avatar Apr 14 '25 10:04 SmallhillCZ