Skip to content

Commit 071540f

Browse files
authored
fix path with unescaped value (#19938)
1 parent eb92eeb commit 071540f

File tree

41 files changed

+53
-53
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+53
-53
lines changed

modules/openapi-generator/src/main/resources/Ada/client-body.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ package body {{package}}.Clients is
5151
URI.Add_Param ("{{baseName}}", {{paramName}});{{/isLong}}{{#isContainer}}
5252
URI.Add_Param ("{{baseName}}", {{paramName}});{{/isContainer}}{{#isDateTime}}
5353
URI.Add_Param ("{{baseName}}", {{paramName}});{{/isDateTime}}{{/isQueryParam}}{{/queryParams}}
54-
URI.Set_Path ("{{path}}");{{#pathParams}}
54+
URI.Set_Path ("{{{path}}}");{{#pathParams}}
5555
URI.Set_Path_Param ("{{baseName}}", {{^isString}}{{#vendorExtensions.x-is-model-type}}{{package}}.Models{{/vendorExtensions.x-is-model-type}}{{^vendorExtensions.x-is-model-type}}{{openApiPackageName}}{{/vendorExtensions.x-is-model-type}}.To_String ({{/isString}}{{paramName}}{{^isString}}){{/isString}});{{/pathParams}}
5656
Client.Call ({{openApiPackageName}}.Clients.{{httpMethod}}, URI{{#hasBodyParam}}, Req{{/hasBodyParam}}{{#hasFormParams}}, Req{{/hasFormParams}}{{#returnType}}, Reply{{/returnType}});
5757
{{#returnProperty}}

modules/openapi-generator/src/main/resources/Ada/server-skeleton-body.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ package body {{package}}.Skeletons is
2727
new {{openApiPackageName}}.Servers.Operation
2828
(Handler => {{operationId}},
2929
Method => {{openApiPackageName}}.Servers.{{httpMethod}},
30-
URI => URI_Prefix & "{{path}}",
30+
URI => URI_Prefix & "{{{path}}}",
3131
{{#vendorExtensions.x-produces-media-index}}
3232
Mimes => Media_List_{{vendorExtensions.x-produces-media-index}}'Access);
3333
{{/vendorExtensions.x-produces-media-index}}
@@ -259,7 +259,7 @@ package body {{package}}.Skeletons is
259259
new {{openApiPackageName}}.Servers.Operation
260260
(Handler => {{operationId}},
261261
Method => {{openApiPackageName}}.Servers.{{httpMethod}},
262-
URI => URI_Prefix & "{{path}}",
262+
URI => URI_Prefix & "{{{path}}}",
263263
{{#vendorExtensions.x-produces-media-index}}
264264
Mimes => Media_List_{{vendorExtensions.x-produces-media-index}}'Access);
265265
{{/vendorExtensions.x-produces-media-index}}

modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public class {{classname}} {
195195
{{#returnType}}
196196
GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {};
197197
{{/returnType}}
198-
return apiClient.invokeAPI("{{classname}}.{{operationId}}", {{#hasPathParams}}localVarPath{{/hasPathParams}}{{^hasPathParams}}"{{path}}"{{/hasPathParams}}, "{{httpMethod}}", {{#queryParams}}{{#-first}}localVarQueryParams{{/-first}}{{/queryParams}}{{^queryParams}}new ArrayList<>(){{/queryParams}}, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}},
198+
return apiClient.invokeAPI("{{classname}}.{{operationId}}", {{#hasPathParams}}localVarPath{{/hasPathParams}}{{^hasPathParams}}"{{{path}}}"{{/hasPathParams}}, "{{httpMethod}}", {{#queryParams}}{{#-first}}localVarQueryParams{{/-first}}{{/queryParams}}{{^queryParams}}new ArrayList<>(){{/queryParams}}, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}},
199199
{{#headerParams}}{{#-first}}localVarHeaderParams{{/-first}}{{/headerParams}}{{^headerParams}}new LinkedHashMap<>(){{/headerParams}}, {{#cookieParams}}{{#-first}}localVarCookieParams{{/-first}}{{/cookieParams}}{{^cookieParams}}new LinkedHashMap<>(){{/cookieParams}}, {{#formParams}}{{#-first}}localVarFormParams{{/-first}}{{/formParams}}{{^formParams}}new LinkedHashMap<>(){{/formParams}}, localVarAccept, localVarContentType,
200200
{{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}});
201201
}

modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public class {{classname}} {
195195
{{#returnType}}
196196
GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {};
197197
{{/returnType}}
198-
return apiClient.invokeAPI("{{classname}}.{{operationId}}", {{#hasPathParams}}localVarPath{{/hasPathParams}}{{^hasPathParams}}"{{path}}"{{/hasPathParams}}, "{{httpMethod}}", {{#queryParams}}{{#-first}}localVarQueryParams{{/-first}}{{/queryParams}}{{^queryParams}}new ArrayList<>(){{/queryParams}}, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}},
198+
return apiClient.invokeAPI("{{classname}}.{{operationId}}", {{#hasPathParams}}localVarPath{{/hasPathParams}}{{^hasPathParams}}"{{{path}}}"{{/hasPathParams}}, "{{httpMethod}}", {{#queryParams}}{{#-first}}localVarQueryParams{{/-first}}{{/queryParams}}{{^queryParams}}new ArrayList<>(){{/queryParams}}, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}},
199199
{{#headerParams}}{{#-first}}localVarHeaderParams{{/-first}}{{/headerParams}}{{^headerParams}}new LinkedHashMap<>(){{/headerParams}}, {{#cookieParams}}{{#-first}}localVarCookieParams{{/-first}}{{/cookieParams}}{{^cookieParams}}new LinkedHashMap<>(){{/cookieParams}}, {{#formParams}}{{#-first}}localVarFormParams{{/-first}}{{/formParams}}{{^formParams}}new LinkedHashMap<>(){{/formParams}}, localVarAccept, localVarContentType,
200200
{{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}});
201201
}

modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public class {{classname}} {
146146
public static class {{operationIdCamelCase}}Oper implements Oper {
147147
148148
public static final Method REQ_METHOD = {{httpMethod}};
149-
public static final String REQ_URI = "{{path}}";
149+
public static final String REQ_URI = "{{{path}}}";
150150

151151
private RequestSpecBuilder reqSpec;
152152
private ResponseSpecBuilder respSpec;
@@ -163,7 +163,7 @@ public class {{classname}} {
163163
}
164164

165165
/**
166-
* {{httpMethod}} {{path}}
166+
* {{httpMethod}} {{{path}}}
167167
* @param handler handler
168168
* @param <T> type
169169
* @return type
@@ -175,7 +175,7 @@ public class {{classname}} {
175175
{{#returnType}}
176176

177177
/**
178-
* {{httpMethod}} {{path}}
178+
* {{httpMethod}} {{{path}}}
179179
* @param handler handler
180180
* @return {{returnType}}
181181
*/

modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/es6/api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default class {{classname}} {
5454
{{operationId}}() {
5555
return {
5656
method: '{{httpMethod}}',
57-
url: this.basePath + '{{path}}'
57+
url: this.basePath + '{{{path}}}'
5858
{{#pathParams}}
5959
.replace('{' + '{{baseName}}' + '}', ':{{paramName}}')
6060
{{/pathParams}}

modules/openapi-generator/src/main/resources/apache2/apache-config.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{#operations}}
22
{{#operation}}
3-
<Location "{{basePathWithoutHost}}{{path}}">
3+
<Location "{{{basePathWithoutHost}}}{{{path}}}">
44
{{>authConf}}
55
<LimitExcept GET POST PUT DELETE>
66
Require valid-user

modules/openapi-generator/src/main/resources/apex/api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public class {{classname}} {
7474
{{/formParams}}
7575

7676
{{#returnType}}return ({{{.}}}) {{/returnType}}client.invoke(
77-
'{{httpMethod}}', '{{path}}',{{#bodyParam}}
77+
'{{httpMethod}}', '{{{path}}}',{{#bodyParam}}
7878
({{{dataType}}}) params.get('{{paramName}}'){{/bodyParam}}{{^bodyParam}} ''{{/bodyParam}},
7979
query, form,
8080
new Map<String, Object>{{#hasPathParams}}{

modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ std::string convertMapResponse(const std::map<KEY_T, VAL_T>& map)
104104

105105
namespace {{classname}}Resources {
106106
{{#operation}}
107-
{{vendorExtensions.x-codegen-resource-name}}Resource::{{vendorExtensions.x-codegen-resource-name}}Resource(const std::string& context /* = "{{contextPath}}" */)
107+
{{vendorExtensions.x-codegen-resource-name}}Resource::{{vendorExtensions.x-codegen-resource-name}}Resource(const std::string& context /* = "{{{contextPath}}}" */)
108108
{
109-
this->set_path(context + "{{path}}");
109+
this->set_path(context + "{{{path}}}");
110110
this->set_method_handler("{{httpMethod}}",
111111
std::bind(&{{vendorExtensions.x-codegen-resource-name}}Resource::handler_{{httpMethod}}_internal, this,
112112
std::placeholders::_1));

modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ namespace {{packageName}}.{{apiPackage}}
380380
uriBuilderLocalVar.Host = HttpClient.BaseAddress{{nrt!}}.Host;
381381
uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port;
382382
uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme;
383-
uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "{{path}}";
383+
uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "{{{path}}}";
384384
{{/servers}}
385385
{{#servers}}
386386
{{#-first}}
@@ -621,7 +621,7 @@ namespace {{packageName}}.{{apiPackage}}
621621

622622
ILogger<{{operationId}}ApiResponse> apiResponseLoggerLocalVar = LoggerFactory.CreateLogger<{{operationId}}ApiResponse>();
623623

624-
{{operationId}}ApiResponse apiResponseLocalVar = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "{{path}}", requestedAtLocalVar, _jsonSerializerOptions);
624+
{{operationId}}ApiResponse apiResponseLocalVar = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "{{{path}}}", requestedAtLocalVar, _jsonSerializerOptions);
625625

626626
After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}});
627627

@@ -674,7 +674,7 @@ namespace {{packageName}}.{{apiPackage}}
674674
}
675675
catch(Exception e)
676676
{
677-
OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}e "{{path}}" uriBuilderLocalVar.Path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}});
677+
OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}e "{{{path}}}" uriBuilderLocalVar.Path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}});
678678
Events.ExecuteOnError{{operationId}}(e);
679679
throw;
680680
}

0 commit comments

Comments
 (0)