fix(NestJS): use correct typing for default headers#10616
fix(NestJS): use correct typing for default headers#10616macjohnny merged 3 commits intoOpenAPITools:masterfrom
Conversation
amakhrov
left a comment
There was a problem hiding this comment.
Thanks for your contribution!
The fix looks good.
I noticed that later in the service class there is a bug related to defaultHeaders:
let headers = this.defaultHeaders;
...
if ({{paramName}}) {
headers['{{baseName}}'] = {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']);
}
This mutates defaultHeaders, affecting all future calls (even to different endpoints).
I assume you rely on the typescript-nestjs generator in your project, so you might want to address this issue as well (doesn't have to be in this PR though :) )
Sure, I would be interested in getting that as well. I have a few other changes to be made as well, to address updates in NestJS v8, but am not sure how to maintain backwards compatibility. Is there a set procedure for doing so? As an example, one specific change I am thinking of is changing the import of |
|
As for breaking changes - if there is a good reason for that (like in your case, where httpservice in nestjs/common is officially deprecated), you still create a PR, and it can target the next major release of openapi-generator. Alternatively, you can add a config option to the generator, e.g. |
|
@bilalshaikh42 thanks for your contribution. can you please update the samples? |
|
@macjohnny |
|
Though it seems the next few steps worked fine, so I pushed those. Let me know if there is anything else I need to do! |
…/api.service.mustache Co-authored-by: Alexey Makhrov <[email protected]>
4f01a4e to
ac0dfc0
Compare
closes #10615
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master(5.3.0),6.0.x@TiFu @taxpon @sebastianhaas @kenisteward @Vrolijkx @macjohnny @topce @akehir @petejohansonxo @amakhrov