fix(typescript-nestjs): handle query params serialization properly#20755
Merged
macjohnny merged 2 commits intoOpenAPITools:masterfrom Mar 10, 2025
Merged
Conversation
55edc7a to
3b357a2
Compare
Member
|
Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/OpenAPITools/openapi-generator/graphs/contributors. Let me know if you need help fixing it. |
Member
|
can you please follow step 3 in the PR checklist to update the samples ? cc @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @topce (2018/10) @akehir (2019/07) @petejohansonxo (2019/11) @amakhrov (2020/02) @davidgamero (2022/03) @mkusaka (2022/04) @joscha (2024/10) |
Member
|
@mahmoudzeyada please update the samples |
Contributor
Author
|
Okay I will update |
3b357a2 to
67c42f9
Compare
Contributor
Author
|
@macjohnny @wing328 updated samples and fixed git author-related error |
kpy3
pushed a commit
to kpy3/openapi-generator
that referenced
this pull request
Mar 13, 2025
…penAPITools#20755) * fix(typescript-nestjs): handle query params serialization properly * fix(typescript-nestjs): updated the samples for param serialization fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Properly Serialize Query Parameters in OpenAPI Generator for TypeScript NestJS
Issue
The current template assigns query parameters using:
However, this does not work with
URLSearchParams, as it does not allow direct property assignment. Instead, it requires.set()or.append()to properly modify query parameters.Fix
Replace the assignment with:
queryParameters.append('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']));This ensures that query parameters are correctly added and serialized in the request URL.