Skip to content

How to process response headers with apiClient #78

Answered by Himenon
TB-Koma asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks @TB-Koma for using the library.

There are two ways to make the Response Header be accepted directly as the return value of a Method.

The first way is to extend RequestOption after code generation. I wrote a sample code in this Pull Request.

https://github.com/Himenon/openapi-typescript-code-generator/pull/79/files#diff-a34ad3f9712a13614328783b1b59a378140f85cef97da12a840f4416096cdcdaR6-R58

This method is the one you can try right now.

The second method is to create your own code template, although it is more time-consuming.
If you are familiar with AST, you can write code to receive the Header directly from the Method return value by modifying it here.

https://github.com/Himenon/ope…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@TB-Koma
Comment options

Answer selected by TB-Koma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants