Skip to content

added --unwrap-response-data to unwrap the data item from the response #268

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

Merged
merged 2 commits into from
Jun 18, 2021

Conversation

laktak
Copy link
Contributor

@laktak laktak commented Jun 14, 2021

This is trying to solve #267.

Please let me know if this approach fits with your project.

@js2me
Copy link
Member

js2me commented Jun 14, 2021

Hello @laktak !
Thanks for this PR with the nice feature!
Please make changes for axios-http-client eta template too

@js2me js2me linked an issue Jun 14, 2021 that may be closed by this pull request
@js2me js2me added the enhancement New feature or request label Jun 14, 2021
@laktak
Copy link
Contributor Author

laktak commented Jun 14, 2021

@js2me I tried to add it according to the axios documentation.

I've tested the fetch implementation but I'm not using the axios client. Could you add some tests?

@js2me js2me merged commit 37efbb9 into acacode:next Jun 18, 2021
@js2me js2me mentioned this pull request Jul 14, 2021
js2me added a commit that referenced this pull request Jul 14, 2021
* added --unwrap-response-data to unwrap the data item from the response (#268)

* added --unwrap-response-data to unwrap the data item from the response

* add axios --unwrap-response-data

Co-authored-by: Christian Zangl <[email protected]>

* fix: formdata in axios template (#277)

Co-authored-by: Tiago Kaneta <[email protected]>

* Feature: add full response typing for status code, data and headers. (#272)

This commit adds additional type information to the route's response
object that allows types to be created that express the combination
of status code, data and headers for each response.

This type information can be used to "narrow" a response type based on
an HTTP status code. This narrowing is useful since it can prevent type
mismatches where a status code is presumed to have one type but in actuality
it returns another.

Additionally, response headers are now associated with data types and status
codes rather than being free form.

A caveat right now is that only there are no response codes like 3XX or
5XX, every code must be explicitly listed.

* bump: up version to 9.2.0

Co-authored-by: Christian Zangl <[email protected]>
Co-authored-by: Christian Zangl <[email protected]>
Co-authored-by: Tiago Surjus Kaneta <[email protected]>
Co-authored-by: Tiago Kaneta <[email protected]>
Co-authored-by: Rusty Conover <[email protected]>
@Liugq5713
Copy link

Liugq5713 commented Jan 12, 2022

@laktak forget to modify index.d.ts file ?

@laktak
Copy link
Contributor Author

laktak commented Jan 12, 2022

@laktak forget to modify index.d.ts file ?

Yes, I'm using the CLI version and did not notice that it had one.

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

Successfully merging this pull request may close these issues.

Generate Client without HttpResponse / ".data"
3 participants