Skip to content
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

Variables in toPathExpression need to be encoded #208

Merged
merged 1 commit into from
Mar 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ng-swagger-gen.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function ngSwaggerGen(options) {
}

setupProxy();

$RefParser.bundle(options.swagger, { dereference: { circular: false } }).then(
data => {
doGenerate(data, options);
Expand Down Expand Up @@ -60,7 +60,7 @@ function setupProxy() {
* the correct proxy address. Additionally we need to remove HTTP_PROXY
* and HTTPS_PROXY environment variables, if present.
* This is again for globalTunnel compatibility.
*
*
* This method only needs to be run when global-agent is used
*/
function getProxyAndSetupEnv() {
Expand Down Expand Up @@ -1006,8 +1006,8 @@ function toPathExpression(operationParameters, paramsClass, path) {
const param = operationParameters.find(p => p.paramName === pName);
const paramName = param ? param.paramVar : pName;
return paramsClass ?
"${params." + paramName + "}" :
"${" + paramName + "}";
"${encodeURIComponent(params." + paramName + ")}" :
"${encodeURIComponent(" + paramName + ")}";
});
}

Expand Down