fix(powershell): replace UrlEncode with System.Uri EscapeDataString for path parameter encoding - #24604
Merged
wing328 merged 1 commit intoAug 4, 2026
Conversation
Contributor
Author
|
@FeckNeck could you try changing the |
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Mattias-Sehlstedt
force-pushed
the
encode-powershell-path-parameters
branch
from
August 4, 2026 10:18
2a14284 to
7588ce6
Compare
…or path parameter encoding
Mattias-Sehlstedt
force-pushed
the
encode-powershell-path-parameters
branch
from
August 4, 2026 10:30
7588ce6 to
60588c8
Compare
Sorry for the late reply. I'm still quite new to OpenAPI Generator, actually. |
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.
Path parameters are currently encoded with
UrlEncode, but in the documentation there is a remark for how it will handle spaces, and it suggests to instead useUrlPathEncode.Edit: The solution has been adjusted to using
System.UriandEscapeDataStringbased on feedback. This sinceUrlPathEncodeis designed for full path construction and not the path-by-path template building that is occurring in code.Could be considered a breaking change if someone relies on a space being encoded as
+rather than the usual%20. The current behavior comes from #9688.Fixes: #24602
PR checklist
Commit all changed files.
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*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
Summary by cubic
Corrected path parameter encoding in PowerShell clients so spaces encode as %20 and “+” is no longer used. Replaced
UrlEncodewith[System.Uri]::EscapeDataStringto follow .NET guidance (fixes #24602).Bug Fixes
api.mustacheto encode path params with[System.Uri]::EscapeDataString([string]$param).Migration
%20instead of+. Update expectations or pin the previous generator version.Written for commit 60588c8. Summary will update on new commits.