Skip to content

Generate Client without HttpResponse / ".data" #267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
laktak opened this issue Jun 10, 2021 · 3 comments · Fixed by #268
Closed

Generate Client without HttpResponse / ".data" #267

laktak opened this issue Jun 10, 2021 · 3 comments · Fixed by #268

Comments

@laktak
Copy link
Contributor

laktak commented Jun 10, 2021

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.

@js2me
Copy link
Member

js2me commented Jun 11, 2021

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

@laktak
Copy link
Contributor Author

laktak commented Jun 14, 2021

@js2me thanks, I added a possible solution.

@rustyconover
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants