-
Hello, Thank you for developing this awesome generator. My current code: const codeGenerator = new CodeGenerator(outFile)
codeGenerator.validateOpenApiSchema()
const apiClientGeneratorTemplate: Types.CodeGenerator.CustomGenerator<Templates.ApiClient.Option> =
{
generator: Templates.ApiClient.generator,
option: {},
}
let code = codeGenerator.generateTypeDefinition([
codeGenerator.getAdditionalTypeDefinitionCustomCodeGenerator(),
apiClientGeneratorTemplate,
]) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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 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. My personal recommendation is that the first method is easier. |
Beta Was this translation helpful? Give feedback.
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…