Open hisuwh opened 3 years ago
See https://github.com/RicoSuter/NSwag/wiki/Templates but i'm not sure whether the templating is powerful enough to implement that purely in liquid... in general it would be nice to have this as another option in the ts generator
Any updates on this?
I have many api endpoints in my application that look like this:
With
SomethingRequest
looking something like this:The method in my Axios Typescript output looks something like this:
Meaning if I want to make a request specifying the order but nothing else I have to do:
If I was using axios directly I could do this:
What I would like is the option for NSwag to generate client methods within optional parameters in an object or interface so you get something like this:
And you can call it like this:
As well as being cleaner this protects you from bugs caused by the order of parameters changing.
I would be tempted to write my own templates to solve this but I cannot find any documentation on how to do this, and how to configure nswag to reference them.