swagger-typescript-api icon indicating copy to clipboard operation
swagger-typescript-api copied to clipboard

Generate Client without HttpResponse / ".data"

Open laktak opened this issue 3 years ago • 3 comments

Could swagger-typescript-api generate a client that returns

  • Promise<T>
  • instead of Promise<HttpResponse<T, E>>?

99% of the time I'm only interested in the actual data and doing .data makes the code less readable.

laktak avatar Jun 10 '21 18:06 laktak

It is only possible if you customize eta templates.
And I suppose also with using --single-http-client

js2me avatar Jun 11 '21 06:06 js2me

@js2me thanks, I added a possible solution.

laktak avatar Jun 14 '21 18:06 laktak

@js2me it might be good to document that using this makes the response headers inaccessible.

rustyconover avatar Jun 19 '21 21:06 rustyconover