From 071540f55a6a69471a118446dc05e76a59de0940 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 22 Oct 2024 15:07:46 +0800 Subject: [PATCH] fix path with unescaped value (#19938) --- .../src/main/resources/Ada/client-body.mustache | 2 +- .../src/main/resources/Ada/server-skeleton-body.mustache | 4 ++-- .../src/main/resources/Java/libraries/jersey2/api.mustache | 2 +- .../src/main/resources/Java/libraries/jersey3/api.mustache | 2 +- .../main/resources/Java/libraries/rest-assured/api.mustache | 6 +++--- .../resources/Javascript-Closure-Angular/es6/api.mustache | 2 +- .../src/main/resources/apache2/apache-config.mustache | 2 +- .../openapi-generator/src/main/resources/apex/api.mustache | 2 +- .../main/resources/cpp-restbed-server/api-source.mustache | 4 ++-- .../resources/csharp/libraries/generichost/api.mustache | 6 +++--- .../src/main/resources/erlang-server/handler.mustache | 2 +- .../main/resources/fsharp-functions-server/Handler.mustache | 2 +- .../main/resources/fsharp-giraffe-server/Program.mustache | 2 +- .../src/main/resources/haskell-yesod/config/routes.mustache | 2 +- .../src/main/resources/java-camel-server/api.mustache | 2 +- .../src/main/resources/java-camel-server/test.mustache | 4 ++-- .../resources/java-pkmst/cucumber/cucumberTest.mustache | 2 +- .../resources/java-pkmst/cucumber/executeReport.mustache | 4 ++-- .../src/main/resources/java-pkmst/gatling/testapi.mustache | 2 +- .../security/resourceServerConfiguration.mustache | 4 ++-- .../src/main/resources/jetbrains-http-client/api.mustache | 2 +- .../src/main/resources/julia-client/api.mustache | 2 +- .../src/main/resources/julia-server/api.mustache | 2 +- .../src/main/resources/julia-server/server.mustache | 2 +- .../kotlin-server/libraries/javalin5/Main.kt.mustache | 2 +- .../kotlin-server/libraries/ktor/Paths.kt.mustache | 4 ++-- .../src/main/resources/kotlin-spring/api.mustache | 2 +- .../src/main/resources/kotlin-spring/apiInterface.mustache | 2 +- .../src/main/resources/kotlin-wiremock/api-stub.mustache | 2 +- .../src/main/resources/openapi-static/operation.mustache | 2 +- .../src/main/resources/php-dt/ApiClient.php.mustache | 2 +- .../src/main/resources/php-symfony/routing.mustache | 2 +- .../src/main/resources/postman-collection/item.mustache | 4 ++-- .../src/main/resources/python-fastapi/api.mustache | 2 +- modules/openapi-generator/src/main/resources/r/api.mustache | 2 +- .../src/main/resources/ruby-on-rails-server/routes.mustache | 2 +- .../src/main/resources/scala-lagom-server/api.mustache | 2 +- .../scala-play-server/app/apiController.scala.mustache | 2 +- .../src/main/resources/scalaz/api.mustache | 4 ++-- .../src/main/resources/swift-combine/api.mustache | 2 +- .../src/main/resources/zapier/api.mustache | 2 +- 41 files changed, 53 insertions(+), 53 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Ada/client-body.mustache b/modules/openapi-generator/src/main/resources/Ada/client-body.mustache index 4cc52df49467..75478cd6ded3 100644 --- a/modules/openapi-generator/src/main/resources/Ada/client-body.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/client-body.mustache @@ -51,7 +51,7 @@ package body {{package}}.Clients is URI.Add_Param ("{{baseName}}", {{paramName}});{{/isLong}}{{#isContainer}} URI.Add_Param ("{{baseName}}", {{paramName}});{{/isContainer}}{{#isDateTime}} URI.Add_Param ("{{baseName}}", {{paramName}});{{/isDateTime}}{{/isQueryParam}}{{/queryParams}} - URI.Set_Path ("{{path}}");{{#pathParams}} + URI.Set_Path ("{{{path}}}");{{#pathParams}} 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}} Client.Call ({{openApiPackageName}}.Clients.{{httpMethod}}, URI{{#hasBodyParam}}, Req{{/hasBodyParam}}{{#hasFormParams}}, Req{{/hasFormParams}}{{#returnType}}, Reply{{/returnType}}); {{#returnProperty}} diff --git a/modules/openapi-generator/src/main/resources/Ada/server-skeleton-body.mustache b/modules/openapi-generator/src/main/resources/Ada/server-skeleton-body.mustache index fbd7e2f4ce22..2d3e3c2dc00b 100644 --- a/modules/openapi-generator/src/main/resources/Ada/server-skeleton-body.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/server-skeleton-body.mustache @@ -27,7 +27,7 @@ package body {{package}}.Skeletons is new {{openApiPackageName}}.Servers.Operation (Handler => {{operationId}}, Method => {{openApiPackageName}}.Servers.{{httpMethod}}, - URI => URI_Prefix & "{{path}}", + URI => URI_Prefix & "{{{path}}}", {{#vendorExtensions.x-produces-media-index}} Mimes => Media_List_{{vendorExtensions.x-produces-media-index}}'Access); {{/vendorExtensions.x-produces-media-index}} @@ -259,7 +259,7 @@ package body {{package}}.Skeletons is new {{openApiPackageName}}.Servers.Operation (Handler => {{operationId}}, Method => {{openApiPackageName}}.Servers.{{httpMethod}}, - URI => URI_Prefix & "{{path}}", + URI => URI_Prefix & "{{{path}}}", {{#vendorExtensions.x-produces-media-index}} Mimes => Media_List_{{vendorExtensions.x-produces-media-index}}'Access); {{/vendorExtensions.x-produces-media-index}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache index 4fcc047a5b2d..0fc1a57032f1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache @@ -195,7 +195,7 @@ public class {{classname}} { {{#returnType}} GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {}; {{/returnType}} - 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}}, + 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}}, {{#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, {{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache index 8d3e62f27733..3beebe5cb9cb 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache @@ -195,7 +195,7 @@ public class {{classname}} { {{#returnType}} GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {}; {{/returnType}} - 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}}, + 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}}, {{#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, {{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache index f865f0956400..1eae54272a68 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache @@ -146,7 +146,7 @@ public class {{classname}} { public static class {{operationIdCamelCase}}Oper implements Oper { public static final Method REQ_METHOD = {{httpMethod}}; - public static final String REQ_URI = "{{path}}"; + public static final String REQ_URI = "{{{path}}}"; private RequestSpecBuilder reqSpec; private ResponseSpecBuilder respSpec; @@ -163,7 +163,7 @@ public class {{classname}} { } /** - * {{httpMethod}} {{path}} + * {{httpMethod}} {{{path}}} * @param handler handler * @param type * @return type @@ -175,7 +175,7 @@ public class {{classname}} { {{#returnType}} /** - * {{httpMethod}} {{path}} + * {{httpMethod}} {{{path}}} * @param handler handler * @return {{returnType}} */ diff --git a/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/es6/api.mustache b/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/es6/api.mustache index 6a19ba362edd..c0df3cd07f1d 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/es6/api.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/es6/api.mustache @@ -54,7 +54,7 @@ export default class {{classname}} { {{operationId}}() { return { method: '{{httpMethod}}', - url: this.basePath + '{{path}}' + url: this.basePath + '{{{path}}}' {{#pathParams}} .replace('{' + '{{baseName}}' + '}', ':{{paramName}}') {{/pathParams}} diff --git a/modules/openapi-generator/src/main/resources/apache2/apache-config.mustache b/modules/openapi-generator/src/main/resources/apache2/apache-config.mustache index 51ea0a13749e..811766ebafdd 100644 --- a/modules/openapi-generator/src/main/resources/apache2/apache-config.mustache +++ b/modules/openapi-generator/src/main/resources/apache2/apache-config.mustache @@ -1,6 +1,6 @@ {{#operations}} {{#operation}} - + {{>authConf}} Require valid-user diff --git a/modules/openapi-generator/src/main/resources/apex/api.mustache b/modules/openapi-generator/src/main/resources/apex/api.mustache index e4b0082e8636..f7414c60febe 100644 --- a/modules/openapi-generator/src/main/resources/apex/api.mustache +++ b/modules/openapi-generator/src/main/resources/apex/api.mustache @@ -74,7 +74,7 @@ public class {{classname}} { {{/formParams}} {{#returnType}}return ({{{.}}}) {{/returnType}}client.invoke( - '{{httpMethod}}', '{{path}}',{{#bodyParam}} + '{{httpMethod}}', '{{{path}}}',{{#bodyParam}} ({{{dataType}}}) params.get('{{paramName}}'){{/bodyParam}}{{^bodyParam}} ''{{/bodyParam}}, query, form, new Map{{#hasPathParams}}{ diff --git a/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache index 37275cd03e57..b15e8d259b03 100644 --- a/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache @@ -104,9 +104,9 @@ std::string convertMapResponse(const std::map& map) namespace {{classname}}Resources { {{#operation}} -{{vendorExtensions.x-codegen-resource-name}}Resource::{{vendorExtensions.x-codegen-resource-name}}Resource(const std::string& context /* = "{{contextPath}}" */) +{{vendorExtensions.x-codegen-resource-name}}Resource::{{vendorExtensions.x-codegen-resource-name}}Resource(const std::string& context /* = "{{{contextPath}}}" */) { - this->set_path(context + "{{path}}"); + this->set_path(context + "{{{path}}}"); this->set_method_handler("{{httpMethod}}", std::bind(&{{vendorExtensions.x-codegen-resource-name}}Resource::handler_{{httpMethod}}_internal, this, std::placeholders::_1)); diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api.mustache index 1b414eb8e5df..bd8d6fae4933 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api.mustache @@ -380,7 +380,7 @@ namespace {{packageName}}.{{apiPackage}} uriBuilderLocalVar.Host = HttpClient.BaseAddress{{nrt!}}.Host; uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "{{path}}"; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "{{{path}}}"; {{/servers}} {{#servers}} {{#-first}} @@ -621,7 +621,7 @@ namespace {{packageName}}.{{apiPackage}} ILogger<{{operationId}}ApiResponse> apiResponseLoggerLocalVar = LoggerFactory.CreateLogger<{{operationId}}ApiResponse>(); - {{operationId}}ApiResponse apiResponseLocalVar = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "{{path}}", requestedAtLocalVar, _jsonSerializerOptions); + {{operationId}}ApiResponse apiResponseLocalVar = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "{{{path}}}", requestedAtLocalVar, _jsonSerializerOptions); After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); @@ -674,7 +674,7 @@ namespace {{packageName}}.{{apiPackage}} } catch(Exception e) { - OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}e "{{path}}" uriBuilderLocalVar.Path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}e "{{{path}}}" uriBuilderLocalVar.Path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); Events.ExecuteOnError{{operationId}}(e); throw; } diff --git a/modules/openapi-generator/src/main/resources/erlang-server/handler.mustache b/modules/openapi-generator/src/main/resources/erlang-server/handler.mustache index 990a0b53c4cd..07a174d18958 100644 --- a/modules/openapi-generator/src/main/resources/erlang-server/handler.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-server/handler.mustache @@ -2,7 +2,7 @@ -moduledoc """ Exposes the following operation IDs: {{#operations}}{{#operation}} -- `{{httpMethod}}` to `{{path}}`, OperationId: `{{operationIdOriginal}}`: +- `{{httpMethod}}` to `{{{path}}}`, OperationId: `{{{operationIdOriginal}}}`: {{summary}}. {{notes}} {{/operation}}{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/Handler.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Handler.mustache index 87a4e1fe6508..d16fd7601b2e 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/Handler.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Handler.mustache @@ -22,7 +22,7 @@ module {{classname}}Handlers = /// [] let {{operationId}} - ([] + ([] req:HttpRequest ) = {{#hasBodyParam}} diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Program.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Program.mustache index 7029285307ac..aa8bba101d97 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Program.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Program.mustache @@ -54,7 +54,7 @@ module App = {{#apis}} {{#operations}} {{#operation}} - {{httpMethod}} >=> {{^hasPathParams}}route{{/hasPathParams}}{{#hasPathParams}}routeBind<{{operationId}}PathParams>{{/hasPathParams}} "{{contextPath}}{{path}}" {{^pathParams}}>=>{{/pathParams}} {{#pathParams}}(fun x -> {{/pathParams}}{{#authMethods}}{{#isOAuth}}requiresAuthentication authFailure{{/isOAuth}}{{#isApiKey}}challenge ApiKeyDefaults.AuthenticationScheme >=> requiresAuthentication authFailure{{/isApiKey}} >=> {{/authMethods}} {{classname}}Handler.{{operationId}}{{#pathParams}} x){{/pathParams}}; + {{httpMethod}} >=> {{^hasPathParams}}route{{/hasPathParams}}{{#hasPathParams}}routeBind<{{operationId}}PathParams>{{/hasPathParams}} "{{contextPath}}{{{path}}}" {{^pathParams}}>=>{{/pathParams}} {{#pathParams}}(fun x -> {{/pathParams}}{{#authMethods}}{{#isOAuth}}requiresAuthentication authFailure{{/isOAuth}}{{#isApiKey}}challenge ApiKeyDefaults.AuthenticationScheme >=> requiresAuthentication authFailure{{/isApiKey}} >=> {{/authMethods}} {{classname}}Handler.{{operationId}}{{#pathParams}} x){{/pathParams}}; {{/operation}} {{/operations}} {{/apis}} diff --git a/modules/openapi-generator/src/main/resources/haskell-yesod/config/routes.mustache b/modules/openapi-generator/src/main/resources/haskell-yesod/config/routes.mustache index 4737e6dc4dd8..1e452fbaaf57 100644 --- a/modules/openapi-generator/src/main/resources/haskell-yesod/config/routes.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-yesod/config/routes.mustache @@ -4,5 +4,5 @@ -- /static StaticR Static appStatic {{#routes}} -{{path}} {{resource}}{{#methods}} {{this}}{{/methods}} +{{{path}}} {{resource}}{{#methods}} {{this}}{{/methods}} {{/routes}} diff --git a/modules/openapi-generator/src/main/resources/java-camel-server/api.mustache b/modules/openapi-generator/src/main/resources/java-camel-server/api.mustache index b90a99de3fef..1f65bf4bdd7d 100644 --- a/modules/openapi-generator/src/main/resources/java-camel-server/api.mustache +++ b/modules/openapi-generator/src/main/resources/java-camel-server/api.mustache @@ -46,7 +46,7 @@ public class {{classname}} extends RouteBuilder { .endSecurityDefinition(){{/-last}}{{/isApiKey}}{{#isBasic}}{{#isBasicBasic}} .basicAuth("{{name}}"){{#-last}}.end(){{/-last}}{{/isBasicBasic}}{{#isBasicBearer}} .bearerToken("{{name}}"{{#bearerFormat}}, "{{bearerFormat}}"{{/bearerFormat}}){{#-last}}.end(){{/-last}}{{/isBasicBearer}}{{/isBasic}}{{/authMethods}}{{/hasAuthMethods}}{{/camelSecurityDefinitions}} - .{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}("{{path}}") + .{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}("{{{path}}}") .description("{{#summary}}{{{.}}}{{/summary}}") .id("{{operationId}}Api"){{#vendorExtensions}}{{#camelRestBindingMode}} .clientRequestValidation(false) diff --git a/modules/openapi-generator/src/main/resources/java-camel-server/test.mustache b/modules/openapi-generator/src/main/resources/java-camel-server/test.mustache index 677f0e522ac0..a136c01b9f93 100644 --- a/modules/openapi-generator/src/main/resources/java-camel-server/test.mustache +++ b/modules/openapi-generator/src/main/resources/java-camel-server/test.mustache @@ -25,7 +25,7 @@ public class {{classname}}Test { public void {{operationId}}TestJson() throws Exception { String contentType = "application/json"; String accept = "application/json"; - String url = API_URL + "{{path}}"; + String url = API_URL + "{{{path}}}"; HttpRequest httpRequest = Unirest.{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}(url);{{#hasConsumes}} httpRequest = httpRequest.header("Content-Type", contentType);{{/hasConsumes}}{{#hasProduces}} httpRequest = httpRequest.header("Accept", accept);{{/hasProduces}}{{#pathParams}} @@ -45,7 +45,7 @@ public class {{classname}}Test { public void {{operationId}}TestXml() throws Exception { String contentType = "application/xml"; String accept = "application/xml"; - String url = API_URL + "{{path}}"; + String url = API_URL + "{{{path}}}"; HttpRequest httpRequest = Unirest.{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}(url);{{#hasConsumes}} httpRequest = httpRequest.header("Content-Type", contentType);{{/hasConsumes}}{{#hasProduces}} httpRequest = httpRequest.header("Accept", accept);{{/hasProduces}}{{#pathParams}} diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/cucumber/cucumberTest.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/cucumber/cucumberTest.mustache index 684121ae59ba..1c91bc1f4eaf 100644 --- a/modules/openapi-generator/src/main/resources/java-pkmst/cucumber/cucumberTest.mustache +++ b/modules/openapi-generator/src/main/resources/java-pkmst/cucumber/cucumberTest.mustache @@ -9,7 +9,7 @@ import cucumber.api.junit.Cucumber; @ActiveProfiles("test") @CucumberOptions(format = { "pretty", "html:target/cucumber-html-report", {{#resourcePaths}} - "json:./report/{{path}}-report-json/{{path}}.json", + "json:./report/{{{path}}}-report-json/{{{path}}}.json", {{/resourcePaths}} }) public class {{serviceName}}Test { } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/cucumber/executeReport.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/cucumber/executeReport.mustache index c60e1ca56420..8d9d09aec543 100644 --- a/modules/openapi-generator/src/main/resources/java-pkmst/cucumber/executeReport.mustache +++ b/modules/openapi-generator/src/main/resources/java-pkmst/cucumber/executeReport.mustache @@ -24,9 +24,9 @@ public class ExecuteReport { Configuration configuration = null; ReportBuilder reportBuilder = null; {{#resourcePaths}} - reportOutputDirectory = new File("./report/{{path}}-report-html/"); + reportOutputDirectory = new File("./report/{{{path}}}-report-html/"); jsonFiles = new ArrayList(); - jsonFiles.add("./report/{{path}}-report-json/{{path}}.json"); + jsonFiles.add("./report/{{{path}}}-report-json/{{{path}}}.json"); configuration = new Configuration(reportOutputDirectory,projectName); // optionally only if you need diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/gatling/testapi.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/gatling/testapi.mustache index a43be9c2269d..8b9cac4b0ef6 100644 --- a/modules/openapi-generator/src/main/resources/java-pkmst/gatling/testapi.mustache +++ b/modules/openapi-generator/src/main/resources/java-pkmst/gatling/testapi.mustache @@ -9,7 +9,7 @@ import org.springframework.boot.SpringApplication import org.springframework.context.ConfigurableApplicationContext -class get{{path}} extends Simulation { +class get{{{path}}} extends Simulation { val app: ConfigurableApplicationContext = SpringApplication.run(classOf[{{basePackage}}.{{serviceName}}Application]) diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/security/resourceServerConfiguration.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/security/resourceServerConfiguration.mustache index 31be12020f88..f2f8889c49ae 100644 --- a/modules/openapi-generator/src/main/resources/java-pkmst/security/resourceServerConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/java-pkmst/security/resourceServerConfiguration.mustache @@ -32,9 +32,9 @@ public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter {{#resourcePaths}} http. anonymous().disable() - .requestMatchers().antMatchers(HttpMethod.GET, "/{{path}}/**") + .requestMatchers().antMatchers(HttpMethod.GET, "/{{{path}}}/**") .and().authorizeRequests() - .antMatchers(HttpMethod.GET, "/{{path}}/**").access("hasRole('ADMIN')") + .antMatchers(HttpMethod.GET, "/{{{path}}}/**").access("hasRole('ADMIN')") .and().exceptionHandling().accessDeniedHandler(new OAuth2AccessDeniedHandler()); {{/resourcePaths}} } diff --git a/modules/openapi-generator/src/main/resources/jetbrains-http-client/api.mustache b/modules/openapi-generator/src/main/resources/jetbrains-http-client/api.mustache index 63a1962eee09..e099e4b23e93 100644 --- a/modules/openapi-generator/src/main/resources/jetbrains-http-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/jetbrains-http-client/api.mustache @@ -5,7 +5,7 @@ {{#vendorExtensions.requests}} ### {{#summary}}{{summary}}{{/summary}} ## {{name}} -{{httpMethod}} {{basePath}}{{#lambda.doubleMustache}}{{path}}{{/lambda.doubleMustache}}{{>queryParams}} +{{httpMethod}} {{basePath}}{{#lambda.doubleMustache}}{{{path}}}{{/lambda.doubleMustache}}{{>queryParams}} {{#consumes}} Content-Type: {{{mediaType}}} {{/consumes}} diff --git a/modules/openapi-generator/src/main/resources/julia-client/api.mustache b/modules/openapi-generator/src/main/resources/julia-client/api.mustache index 3881e7b5d592..e1aaa06369ff 100644 --- a/modules/openapi-generator/src/main/resources/julia-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/julia-client/api.mustache @@ -46,7 +46,7 @@ function _oacinternal_{{operationId}}(_api::{{classname}}{{#allParams}}{{#requir {{/hasValidation}} {{/allParams}} - _ctx = OpenAPI.Clients.Ctx(_api.client, "{{httpMethod}}", _returntypes_{{operationId}}_{{classname}}, "{{path}}", [{{#authMethods}}"{{name}}", {{/authMethods}}]{{#bodyParam}}, {{paramName}}{{/bodyParam}}) + _ctx = OpenAPI.Clients.Ctx(_api.client, "{{httpMethod}}", _returntypes_{{operationId}}_{{classname}}, "{{{path}}}", [{{#authMethods}}"{{name}}", {{/authMethods}}]{{#bodyParam}}, {{paramName}}{{/bodyParam}}) {{#pathParams}} OpenAPI.Clients.set_param(_ctx.path, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{paramName}}{{#isListContainer}}; collection_format="{{collectionFormat}}"{{/isListContainer}}) # type {{dataType}} {{/pathParams}} diff --git a/modules/openapi-generator/src/main/resources/julia-server/api.mustache b/modules/openapi-generator/src/main/resources/julia-server/api.mustache index e65bb670f8e9..89ef0cca2c10 100644 --- a/modules/openapi-generator/src/main/resources/julia-server/api.mustache +++ b/modules/openapi-generator/src/main/resources/julia-server/api.mustache @@ -61,7 +61,7 @@ end function register{{classname}}(router::HTTP.Router, impl; path_prefix::String="", optional_middlewares...) {{#operation}} - HTTP.register!(router, "{{httpMethod}}", path_prefix * "{{path}}", OpenAPI.Servers.middleware(impl, {{operationId}}_read, {{operationId}}_validate, {{operationId}}_invoke; optional_middlewares...)) + HTTP.register!(router, "{{httpMethod}}", path_prefix * "{{{path}}}", OpenAPI.Servers.middleware(impl, {{operationId}}_read, {{operationId}}_validate, {{operationId}}_invoke; optional_middlewares...)) {{/operation}} return router end diff --git a/modules/openapi-generator/src/main/resources/julia-server/server.mustache b/modules/openapi-generator/src/main/resources/julia-server/server.mustache index 772539af9f31..3b075eaf5a50 100644 --- a/modules/openapi-generator/src/main/resources/julia-server/server.mustache +++ b/modules/openapi-generator/src/main/resources/julia-server/server.mustache @@ -10,7 +10,7 @@ The following server methods must be implemented: {{#operations}} {{#operation}} - **{{operationId}}** - - *invocation:* {{httpMethod}} {{path}} + - *invocation:* {{httpMethod}} {{{path}}} - *signature:* {{operationId}}(req::HTTP.Request{{#allParams}}{{#required}}, {{paramName}}::{{dataType}}{{/required}}{{/allParams}};{{#allParams}}{{^required}} {{paramName}}=nothing,{{/required}}{{/allParams}}) -> {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Nothing{{/returnType}} {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/Main.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/Main.kt.mustache index 1628b2fb2b94..f3c418d21f73 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/Main.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/Main.kt.mustache @@ -23,7 +23,7 @@ fun main() { {{#apis}} {{#operations}} {{#operation}} - {{#lowercase}}{{httpMethod}}{{/lowercase}}("{{path}}", {{classname}}::{{operationId}}) + {{#lowercase}}{{httpMethod}}{{/lowercase}}("{{{path}}}", {{classname}}::{{operationId}}) {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/Paths.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/Paths.kt.mustache index 487563c17755..a575ea678772 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/Paths.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/Paths.kt.mustache @@ -18,10 +18,10 @@ object Paths { {{#allParams}}* @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}}*/ {{#hasParams}} - @Serializable @Resource("{{path}}") class {{operationId}}({{#allParams}}val {{paramName}}: {{{dataType}}}{{^required}}? = null{{/required}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + @Serializable @Resource("{{{path}}}") class {{operationId}}({{#allParams}}val {{paramName}}: {{{dataType}}}{{^required}}? = null{{/required}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) {{/hasParams}} {{^hasParams}} - @Serializable @Resource("{{path}}") class {{operationId}} + @Serializable @Resource("{{{path}}}") class {{operationId}} {{/hasParams}} {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache index 9257b1b52f7a..29aac2f26b88 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache @@ -83,7 +83,7 @@ class {{classname}}Controller({{#serviceInterface}}@Autowired(required = true) v value = [{{#responses}}ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}::class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}}]){{/swagger1AnnotationLibrary}} @RequestMapping( method = [RequestMethod.{{httpMethod}}], - value = ["{{#lambdaEscapeInNormalString}}{{path}}{{/lambdaEscapeInNormalString}}"]{{#singleContentTypes}}{{#hasProduces}}, + value = ["{{#lambdaEscapeInNormalString}}{{{path}}}{{/lambdaEscapeInNormalString}}"]{{#singleContentTypes}}{{#hasProduces}}, produces = [{{#vendorExtensions.x-accepts}}"{{{.}}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-accepts}}]{{/hasProduces}}{{#hasConsumes}}, consumes = "{{{vendorExtensions.x-content-type}}}"{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}, produces = [{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}]{{/hasProduces}}{{#hasConsumes}}, diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache index fd6d88119c98..d4549658a934 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache @@ -96,7 +96,7 @@ interface {{classname}} { value = [{{#responses}}ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}::class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}}, {{/-last}}{{/responses}}]){{/swagger1AnnotationLibrary}} @RequestMapping( method = [RequestMethod.{{httpMethod}}], - value = ["{{#lambdaEscapeInNormalString}}{{path}}{{/lambdaEscapeInNormalString}}"]{{#singleContentTypes}}{{#hasProduces}}, + value = ["{{#lambdaEscapeInNormalString}}{{{path}}}{{/lambdaEscapeInNormalString}}"]{{#singleContentTypes}}{{#hasProduces}}, produces = [{{#vendorExtensions.x-accepts}}"{{{.}}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-accepts}}]{{/hasProduces}}{{#hasConsumes}}, consumes = "{{{vendorExtensions.x-content-type}}}"{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}, produces = [{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}]{{/hasProduces}}{{#hasConsumes}}, diff --git a/modules/openapi-generator/src/main/resources/kotlin-wiremock/api-stub.mustache b/modules/openapi-generator/src/main/resources/kotlin-wiremock/api-stub.mustache index fff80e88d9af..d3b79befcf3a 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-wiremock/api-stub.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-wiremock/api-stub.mustache @@ -33,7 +33,7 @@ open class {{classname}}Stubs(private val objectMapper: ObjectMapper) { * @return A [{{operationIdCamelCase}}StubBuilder] to configure the response, and the final [MappingBuilder]. */ fun {{operationId}}({{#pathParams}}{{paramName}}: StringValuePattern, {{/pathParams}}{{#queryParams}}{{paramName}}: StringValuePattern? = null, {{/queryParams}}configurer: MappingBuilder.() -> MappingBuilder = { this }): {{operationIdCamelCase}}StubBuilder = - {{operationIdCamelCase}}StubBuilder(objectMapper, {{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}(urlPathTemplate("{{path}}")) + {{operationIdCamelCase}}StubBuilder(objectMapper, {{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}(urlPathTemplate("{{{path}}}")) {{#pathParams}} .withPathParam("{{baseName}}", {{paramName}}) {{/pathParams}} diff --git a/modules/openapi-generator/src/main/resources/openapi-static/operation.mustache b/modules/openapi-generator/src/main/resources/openapi-static/operation.mustache index a6977c20f43b..39f322d8d1ba 100644 --- a/modules/openapi-generator/src/main/resources/openapi-static/operation.mustache +++ b/modules/openapi-generator/src/main/resources/openapi-static/operation.mustache @@ -9,7 +9,7 @@

{{description}}

{{#notes}}

{{.}}

{{/notes}}

URL

- {{basePath}}{{path}} + {{{basePath}}}{{{path}}}

HTTP Method

{{httpMethod}}

Response Type

diff --git a/modules/openapi-generator/src/main/resources/php-dt/ApiClient.php.mustache b/modules/openapi-generator/src/main/resources/php-dt/ApiClient.php.mustache index 397d21c49c0b..9caa3a9f24e6 100644 --- a/modules/openapi-generator/src/main/resources/php-dt/ApiClient.php.mustache +++ b/modules/openapi-generator/src/main/resources/php-dt/ApiClient.php.mustache @@ -36,7 +36,7 @@ class ApiClient extends OAGAC\AbstractApiClient {{>api_arg_declaration }} ): ResponseInterface { - $request = $this->createRequest('{{httpMethod}}', '{{path}}', {{#pathParams.0}}$this->getPathParameters($parameters){{/pathParams.0}}{{^pathParams.0}}[]{{/pathParams.0}}, {{#queryParams.0}}$this->getQueryParameters($parameters){{/queryParams.0}}{{^queryParams.0}}[]{{/queryParams.0}}); + $request = $this->createRequest('{{httpMethod}}', '{{{path}}}', {{#pathParams.0}}$this->getPathParameters($parameters){{/pathParams.0}}{{^pathParams.0}}[]{{/pathParams.0}}, {{#queryParams.0}}$this->getQueryParameters($parameters){{/queryParams.0}}{{^queryParams.0}}[]{{/queryParams.0}}); {{#headerParams.0}} $request = $this->addCustomHeaders($request, $parameters); {{/headerParams.0}} diff --git a/modules/openapi-generator/src/main/resources/php-symfony/routing.mustache b/modules/openapi-generator/src/main/resources/php-symfony/routing.mustache index cd4a833df0ac..38dd72c9c62c 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/routing.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/routing.mustache @@ -8,7 +8,7 @@ # {{pathPrefix}} {{#operation}} {{bundleAlias}}_{{pathPrefix}}_{{operationIdLowerCase}}: - path: {{path}} + path: {{{path}}} methods: [{{httpMethod}}] defaults: _controller: {{bundleAlias}}.controller.{{pathPrefix}}::{{operationId}}Action diff --git a/modules/openapi-generator/src/main/resources/postman-collection/item.mustache b/modules/openapi-generator/src/main/resources/postman-collection/item.mustache index b5293f8332bf..2d37658ae7ba 100644 --- a/modules/openapi-generator/src/main/resources/postman-collection/item.mustache +++ b/modules/openapi-generator/src/main/resources/postman-collection/item.mustache @@ -1,5 +1,5 @@ { - "name": "{{path}}{{#isDeprecated}} (DEPRECATED){{/isDeprecated}}", + "name": "{{{path}}}{{#isDeprecated}} (DEPRECATED){{/isDeprecated}}", "description": "{{{notes}}}", "item": [ {{#vendorExtensions.postmanRequests}} @@ -27,7 +27,7 @@ } }, "url": { - "raw": "{{=<% %>=}}{{baseUrl}}<%={{ }}=%>{{path}}", + "raw": "{{=<% %>=}}{{baseUrl}}<%={{ }}=%>{{{path}}}", "host": [ "{{=<% %>=}}{{baseUrl}}<%={{ }}=%>" ], diff --git a/modules/openapi-generator/src/main/resources/python-fastapi/api.mustache b/modules/openapi-generator/src/main/resources/python-fastapi/api.mustache index 48bbdc26783e..7c87ef7543cd 100644 --- a/modules/openapi-generator/src/main/resources/python-fastapi/api.mustache +++ b/modules/openapi-generator/src/main/resources/python-fastapi/api.mustache @@ -38,7 +38,7 @@ for _, name, _ in pkgutil.iter_modules(ns_pkg.__path__, ns_pkg.__name__ + "."): {{#operations}} {{#operation}} @router.{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}( - "{{path}}", + "{{{path}}}", responses={ {{#responses}} {{code}}: {{=<% %>=}}{<%#dataType%>"model": <%dataType%>, "description": "<%message%>"<%/dataType%><%^dataType%>"description": "<%message%>"<%/dataType%>}<%={{ }}=%>, diff --git a/modules/openapi-generator/src/main/resources/r/api.mustache b/modules/openapi-generator/src/main/resources/r/api.mustache index 781391d120c6..8fec6e01f861 100644 --- a/modules/openapi-generator/src/main/resources/r/api.mustache +++ b/modules/openapi-generator/src/main/resources/r/api.mustache @@ -461,7 +461,7 @@ {{/bodyParams}} {{/hasBodyParam}} - local_var_url_path <- "{{path}}" + local_var_url_path <- "{{{path}}}" {{#hasPathParams}} {{#pathParams}} if (!missing(`{{paramName}}`)) { diff --git a/modules/openapi-generator/src/main/resources/ruby-on-rails-server/routes.mustache b/modules/openapi-generator/src/main/resources/ruby-on-rails-server/routes.mustache index 520fa841b343..5b8764cc7ca4 100644 --- a/modules/openapi-generator/src/main/resources/ruby-on-rails-server/routes.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-on-rails-server/routes.mustache @@ -12,7 +12,7 @@ Rails.application.routes.draw do {{#apis}} {{#operations}} {{#operation}} - add_openapi_route '{{httpMethod}}', '{{basePathWithoutHost}}{{path}}', controller_name: '{{classVarName}}', action_name: {{#isRestfulIndex}}'index'{{/isRestfulIndex}}{{#isRestfulCreate}}'create'{{/isRestfulCreate}}{{#isRestfulUpdate}}'update'{{/isRestfulUpdate}}{{#isRestfulShow}}'show'{{/isRestfulShow}}{{#isRestfulDestroy}}'destroy'{{/isRestfulDestroy}}{{^isRestful}}'{{nickname}}'{{/isRestful}} + add_openapi_route '{{httpMethod}}', '{{{basePathWithoutHost}}}{{{path}}}', controller_name: '{{classVarName}}', action_name: {{#isRestfulIndex}}'index'{{/isRestfulIndex}}{{#isRestfulCreate}}'create'{{/isRestfulCreate}}{{#isRestfulUpdate}}'update'{{/isRestfulUpdate}}{{#isRestfulShow}}'show'{{/isRestfulShow}}{{#isRestfulDestroy}}'destroy'{{/isRestfulDestroy}}{{^isRestful}}'{{nickname}}'{{/isRestful}} {{/operation}} {{/operations}} {{/apis}} diff --git a/modules/openapi-generator/src/main/resources/scala-lagom-server/api.mustache b/modules/openapi-generator/src/main/resources/scala-lagom-server/api.mustache index 05ae4f9cd935..71d15669d461 100644 --- a/modules/openapi-generator/src/main/resources/scala-lagom-server/api.mustache +++ b/modules/openapi-generator/src/main/resources/scala-lagom-server/api.mustache @@ -18,7 +18,7 @@ trait {{classname}} extends Service { named("{{classname}}").withCalls( {{#operations}} {{#operation}} - restCall(Method.{{httpMethod}}, "{{path}}{{#queryParams.0}}?{{/queryParams.0}}{{#queryParams}}{{paramName}}{{^-last}}&{{/-last}}{{/queryParams}}", {{operationId}} _){{^-last}}, {{/-last}} + restCall(Method.{{httpMethod}}, "{{{path}}}{{#queryParams.0}}?{{/queryParams.0}}{{#queryParams}}{{paramName}}{{^-last}}&{{/-last}}{{/queryParams}}", {{operationId}} _){{^-last}}, {{/-last}} {{/operation}} {{/operations}} ).withAutoAcl(true) diff --git a/modules/openapi-generator/src/main/resources/scala-play-server/app/apiController.scala.mustache b/modules/openapi-generator/src/main/resources/scala-play-server/app/apiController.scala.mustache index 7c7ff18d6193..7ee772ebfd88 100644 --- a/modules/openapi-generator/src/main/resources/scala-play-server/app/apiController.scala.mustache +++ b/modules/openapi-generator/src/main/resources/scala-play-server/app/apiController.scala.mustache @@ -19,7 +19,7 @@ import {{import}} class {{classname}}Controller @Inject()(cc: ControllerComponents, api: {{classname}}){{#supportAsync}}(implicit executionContext: ExecutionContext){{/supportAsync}} extends AbstractController(cc) { {{#operation}} /** - * {{httpMethod}} {{contextPath}}{{path}}{{#queryParams.0}}?{{/queryParams.0}}{{#queryParams}}{{paramName}}=[value]{{^-last}}&{{/-last}}{{/queryParams}} + * {{httpMethod}} {{contextPath}}{{{path}}}{{#queryParams.0}}?{{/queryParams.0}}{{#queryParams}}{{paramName}}=[value]{{^-last}}&{{/-last}}{{/queryParams}} {{#pathParams}} {{#description}} * @param {{paramName}} {{description}} diff --git a/modules/openapi-generator/src/main/resources/scalaz/api.mustache b/modules/openapi-generator/src/main/resources/scalaz/api.mustache index a6c01c909341..9a7edf6360e7 100644 --- a/modules/openapi-generator/src/main/resources/scalaz/api.mustache +++ b/modules/openapi-generator/src/main/resources/scalaz/api.mustache @@ -35,7 +35,7 @@ object {{classname}} { def {{nickname}}(host: String{{#allParams}}{{#-first}}, {{/-first}}{{paramName}}: {{dataType}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{^-last}}, {{/-last}}{{/allParams}}){{#queryParams}}{{#-first}}(implicit {{/-first}}{{paramName}}Query: QueryParam[{{dataType}}]{{^-last}}, {{/-last}}{{#-last}}){{/-last}}{{/queryParams}}: {{>operationReturnType}}{{#returnType}} implicit val returnTypeDecoder: EntityDecoder[{{returnType}}] = jsonOf[{{returnType}}] {{/returnType}} - val path = "{{path}}"{{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}",escape({{paramName}}.toString)){{/pathParams}} + val path = "{{{path}}}"{{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}",escape({{paramName}}.toString)){{/pathParams}} val httpMethod = Method.{{httpMethod}} val contentType = `Content-Type`(MediaType.`application/json`) @@ -64,7 +64,7 @@ class HttpService{{classname}}(service: HttpService) { def {{nickname}}({{#allParams}}{{paramName}}: {{dataType}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{^-last}}, {{/-last}}{{/allParams}}){{#queryParams}}{{#-first}}(implicit {{/-first}}{{paramName}}Query: QueryParam[{{dataType}}]{{^-last}}, {{/-last}}{{#-last}}){{/-last}}{{/queryParams}}: {{>operationReturnType}}{{#returnType}} implicit val returnTypeDecoder: EntityDecoder[{{returnType}}] = jsonOf[{{returnType}}] {{/returnType}} - val path = "{{path}}"{{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}",escape({{paramName}}.toString)){{/pathParams}} + val path = "{{{path}}}"{{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}",escape({{paramName}}.toString)){{/pathParams}} val httpMethod = Method.{{httpMethod}} val contentType = `Content-Type`(MediaType.`application/json`) diff --git a/modules/openapi-generator/src/main/resources/swift-combine/api.mustache b/modules/openapi-generator/src/main/resources/swift-combine/api.mustache index eeb76d81c4d8..db49e368692d 100644 --- a/modules/openapi-generator/src/main/resources/swift-combine/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift-combine/api.mustache @@ -102,7 +102,7 @@ open class {{classname}} { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - {{#pathParams}}{{#-last}}var{{/-last}}{{/pathParams}}{{^pathParams}}let{{/pathParams}} localVarPath = "{{path}}" + {{#pathParams}}{{#-last}}var{{/-last}}{{/pathParams}}{{^pathParams}}let{{/pathParams}} localVarPath = "{{{path}}}" {{#pathParams}} {{#required}}localVarPath = localVarPath.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: {{> toString}}){{/required}}{{^required}}if let {{paramName}} = {{paramName}} { localVarPath = localVarPath.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: {{> toString}}) } {{/required}} {{/pathParams}} diff --git a/modules/openapi-generator/src/main/resources/zapier/api.mustache b/modules/openapi-generator/src/main/resources/zapier/api.mustache index c3e525624012..dec5532594a8 100644 --- a/modules/openapi-generator/src/main/resources/zapier/api.mustache +++ b/modules/openapi-generator/src/main/resources/zapier/api.mustache @@ -80,7 +80,7 @@ module.exports = { {{/allParams}} {{/isMultipart}} const options = { - url: utils.replacePathParameters('{{basePath}}{{path}}'), + url: utils.replacePathParameters('{{{basePath}}}{{{path}}}'), method: '{{httpMethod}}', removeMissingValuesFrom: { params: true, body: true }, headers: {