-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
fix(NestJS): use correct typing for default headers #10616
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 :) )
modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache
Outdated
Show resolved
Hide resolved
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