fix path with unescaped value (#19938)

This commit is contained in:
William Cheng 2024-10-22 15:07:46 +08:00 committed by GitHub
parent eb92eeb32e
commit 071540f55a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
41 changed files with 53 additions and 53 deletions

View File

@ -51,7 +51,7 @@ package body {{package}}.Clients is
URI.Add_Param ("{{baseName}}", {{paramName}});{{/isLong}}{{#isContainer}} URI.Add_Param ("{{baseName}}", {{paramName}});{{/isLong}}{{#isContainer}}
URI.Add_Param ("{{baseName}}", {{paramName}});{{/isContainer}}{{#isDateTime}} URI.Add_Param ("{{baseName}}", {{paramName}});{{/isContainer}}{{#isDateTime}}
URI.Add_Param ("{{baseName}}", {{paramName}});{{/isDateTime}}{{/isQueryParam}}{{/queryParams}} 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}} 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}}); Client.Call ({{openApiPackageName}}.Clients.{{httpMethod}}, URI{{#hasBodyParam}}, Req{{/hasBodyParam}}{{#hasFormParams}}, Req{{/hasFormParams}}{{#returnType}}, Reply{{/returnType}});
{{#returnProperty}} {{#returnProperty}}

View File

@ -27,7 +27,7 @@ package body {{package}}.Skeletons is
new {{openApiPackageName}}.Servers.Operation new {{openApiPackageName}}.Servers.Operation
(Handler => {{operationId}}, (Handler => {{operationId}},
Method => {{openApiPackageName}}.Servers.{{httpMethod}}, Method => {{openApiPackageName}}.Servers.{{httpMethod}},
URI => URI_Prefix & "{{path}}", URI => URI_Prefix & "{{{path}}}",
{{#vendorExtensions.x-produces-media-index}} {{#vendorExtensions.x-produces-media-index}}
Mimes => Media_List_{{vendorExtensions.x-produces-media-index}}'Access); Mimes => Media_List_{{vendorExtensions.x-produces-media-index}}'Access);
{{/vendorExtensions.x-produces-media-index}} {{/vendorExtensions.x-produces-media-index}}
@ -259,7 +259,7 @@ package body {{package}}.Skeletons is
new {{openApiPackageName}}.Servers.Operation new {{openApiPackageName}}.Servers.Operation
(Handler => {{operationId}}, (Handler => {{operationId}},
Method => {{openApiPackageName}}.Servers.{{httpMethod}}, Method => {{openApiPackageName}}.Servers.{{httpMethod}},
URI => URI_Prefix & "{{path}}", URI => URI_Prefix & "{{{path}}}",
{{#vendorExtensions.x-produces-media-index}} {{#vendorExtensions.x-produces-media-index}}
Mimes => Media_List_{{vendorExtensions.x-produces-media-index}}'Access); Mimes => Media_List_{{vendorExtensions.x-produces-media-index}}'Access);
{{/vendorExtensions.x-produces-media-index}} {{/vendorExtensions.x-produces-media-index}}

View File

@ -195,7 +195,7 @@ public class {{classname}} {
{{#returnType}} {{#returnType}}
GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {}; GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {};
{{/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, {{#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}}); {{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}});
} }

View File

@ -195,7 +195,7 @@ public class {{classname}} {
{{#returnType}} {{#returnType}}
GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {}; GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {};
{{/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, {{#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}}); {{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}});
} }

View File

@ -146,7 +146,7 @@ public class {{classname}} {
public static class {{operationIdCamelCase}}Oper implements Oper { public static class {{operationIdCamelCase}}Oper implements Oper {
public static final Method REQ_METHOD = {{httpMethod}}; 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 RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec; private ResponseSpecBuilder respSpec;
@ -163,7 +163,7 @@ public class {{classname}} {
} }
/** /**
* {{httpMethod}} {{path}} * {{httpMethod}} {{{path}}}
* @param handler handler * @param handler handler
* @param <T> type * @param <T> type
* @return type * @return type
@ -175,7 +175,7 @@ public class {{classname}} {
{{#returnType}} {{#returnType}}
/** /**
* {{httpMethod}} {{path}} * {{httpMethod}} {{{path}}}
* @param handler handler * @param handler handler
* @return {{returnType}} * @return {{returnType}}
*/ */

View File

@ -54,7 +54,7 @@ export default class {{classname}} {
{{operationId}}() { {{operationId}}() {
return { return {
method: '{{httpMethod}}', method: '{{httpMethod}}',
url: this.basePath + '{{path}}' url: this.basePath + '{{{path}}}'
{{#pathParams}} {{#pathParams}}
.replace('{' + '{{baseName}}' + '}', ':{{paramName}}') .replace('{' + '{{baseName}}' + '}', ':{{paramName}}')
{{/pathParams}} {{/pathParams}}

View File

@ -1,6 +1,6 @@
{{#operations}} {{#operations}}
{{#operation}} {{#operation}}
<Location "{{basePathWithoutHost}}{{path}}"> <Location "{{{basePathWithoutHost}}}{{{path}}}">
{{>authConf}} {{>authConf}}
<LimitExcept GET POST PUT DELETE> <LimitExcept GET POST PUT DELETE>
Require valid-user Require valid-user

View File

@ -74,7 +74,7 @@ public class {{classname}} {
{{/formParams}} {{/formParams}}
{{#returnType}}return ({{{.}}}) {{/returnType}}client.invoke( {{#returnType}}return ({{{.}}}) {{/returnType}}client.invoke(
'{{httpMethod}}', '{{path}}',{{#bodyParam}} '{{httpMethod}}', '{{{path}}}',{{#bodyParam}}
({{{dataType}}}) params.get('{{paramName}}'){{/bodyParam}}{{^bodyParam}} ''{{/bodyParam}}, ({{{dataType}}}) params.get('{{paramName}}'){{/bodyParam}}{{^bodyParam}} ''{{/bodyParam}},
query, form, query, form,
new Map<String, Object>{{#hasPathParams}}{ new Map<String, Object>{{#hasPathParams}}{

View File

@ -104,9 +104,9 @@ std::string convertMapResponse(const std::map<KEY_T, VAL_T>& map)
namespace {{classname}}Resources { namespace {{classname}}Resources {
{{#operation}} {{#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}}", this->set_method_handler("{{httpMethod}}",
std::bind(&{{vendorExtensions.x-codegen-resource-name}}Resource::handler_{{httpMethod}}_internal, this, std::bind(&{{vendorExtensions.x-codegen-resource-name}}Resource::handler_{{httpMethod}}_internal, this,
std::placeholders::_1)); std::placeholders::_1));

View File

@ -380,7 +380,7 @@ namespace {{packageName}}.{{apiPackage}}
uriBuilderLocalVar.Host = HttpClient.BaseAddress{{nrt!}}.Host; uriBuilderLocalVar.Host = HttpClient.BaseAddress{{nrt!}}.Host;
uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port;
uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme;
uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "{{path}}"; uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "{{{path}}}";
{{/servers}} {{/servers}}
{{#servers}} {{#servers}}
{{#-first}} {{#-first}}
@ -621,7 +621,7 @@ namespace {{packageName}}.{{apiPackage}}
ILogger<{{operationId}}ApiResponse> apiResponseLoggerLocalVar = LoggerFactory.CreateLogger<{{operationId}}ApiResponse>(); 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}}); After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}});
@ -674,7 +674,7 @@ namespace {{packageName}}.{{apiPackage}}
} }
catch(Exception e) 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); Events.ExecuteOnError{{operationId}}(e);
throw; throw;
} }

View File

@ -2,7 +2,7 @@
-moduledoc """ -moduledoc """
Exposes the following operation IDs: Exposes the following operation IDs:
{{#operations}}{{#operation}} {{#operations}}{{#operation}}
- `{{httpMethod}}` to `{{path}}`, OperationId: `{{operationIdOriginal}}`: - `{{httpMethod}}` to `{{{path}}}`, OperationId: `{{{operationIdOriginal}}}`:
{{summary}}. {{summary}}.
{{notes}} {{notes}}
{{/operation}}{{/operations}} {{/operation}}{{/operations}}

View File

@ -22,7 +22,7 @@ module {{classname}}Handlers =
/// </summary> /// </summary>
[<FunctionName("{{operationId}}")>] [<FunctionName("{{operationId}}")>]
let {{operationId}} let {{operationId}}
([<HttpTrigger(Extensions.Http.AuthorizationLevel.Anonymous, "{{httpMethod}}", Route = "{{contextPath}}{{path}}")>] ([<HttpTrigger(Extensions.Http.AuthorizationLevel.Anonymous, "{{httpMethod}}", Route = "{{{contextPath}}}{{{path}}}")>]
req:HttpRequest ) = req:HttpRequest ) =
{{#hasBodyParam}} {{#hasBodyParam}}

View File

@ -54,7 +54,7 @@ module App =
{{#apis}} {{#apis}}
{{#operations}} {{#operations}}
{{#operation}} {{#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}} {{/operation}}
{{/operations}} {{/operations}}
{{/apis}} {{/apis}}

View File

@ -4,5 +4,5 @@
-- /static StaticR Static appStatic -- /static StaticR Static appStatic
{{#routes}} {{#routes}}
{{path}} {{resource}}{{#methods}} {{this}}{{/methods}} {{{path}}} {{resource}}{{#methods}} {{this}}{{/methods}}
{{/routes}} {{/routes}}

View File

@ -46,7 +46,7 @@ public class {{classname}} extends RouteBuilder {
.endSecurityDefinition(){{/-last}}{{/isApiKey}}{{#isBasic}}{{#isBasicBasic}} .endSecurityDefinition(){{/-last}}{{/isApiKey}}{{#isBasic}}{{#isBasicBasic}}
.basicAuth("{{name}}"){{#-last}}.end(){{/-last}}{{/isBasicBasic}}{{#isBasicBearer}} .basicAuth("{{name}}"){{#-last}}.end(){{/-last}}{{/isBasicBasic}}{{#isBasicBearer}}
.bearerToken("{{name}}"{{#bearerFormat}}, "{{bearerFormat}}"{{/bearerFormat}}){{#-last}}.end(){{/-last}}{{/isBasicBearer}}{{/isBasic}}{{/authMethods}}{{/hasAuthMethods}}{{/camelSecurityDefinitions}} .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}}") .description("{{#summary}}{{{.}}}{{/summary}}")
.id("{{operationId}}Api"){{#vendorExtensions}}{{#camelRestBindingMode}} .id("{{operationId}}Api"){{#vendorExtensions}}{{#camelRestBindingMode}}
.clientRequestValidation(false) .clientRequestValidation(false)

View File

@ -25,7 +25,7 @@ public class {{classname}}Test {
public void {{operationId}}TestJson() throws Exception { public void {{operationId}}TestJson() throws Exception {
String contentType = "application/json"; String contentType = "application/json";
String accept = "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 = Unirest.{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}(url);{{#hasConsumes}}
httpRequest = httpRequest.header("Content-Type", contentType);{{/hasConsumes}}{{#hasProduces}} httpRequest = httpRequest.header("Content-Type", contentType);{{/hasConsumes}}{{#hasProduces}}
httpRequest = httpRequest.header("Accept", accept);{{/hasProduces}}{{#pathParams}} httpRequest = httpRequest.header("Accept", accept);{{/hasProduces}}{{#pathParams}}
@ -45,7 +45,7 @@ public class {{classname}}Test {
public void {{operationId}}TestXml() throws Exception { public void {{operationId}}TestXml() throws Exception {
String contentType = "application/xml"; String contentType = "application/xml";
String accept = "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 = Unirest.{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}(url);{{#hasConsumes}}
httpRequest = httpRequest.header("Content-Type", contentType);{{/hasConsumes}}{{#hasProduces}} httpRequest = httpRequest.header("Content-Type", contentType);{{/hasConsumes}}{{#hasProduces}}
httpRequest = httpRequest.header("Accept", accept);{{/hasProduces}}{{#pathParams}} httpRequest = httpRequest.header("Accept", accept);{{/hasProduces}}{{#pathParams}}

View File

@ -9,7 +9,7 @@ import cucumber.api.junit.Cucumber;
@ActiveProfiles("test") @ActiveProfiles("test")
@CucumberOptions(format = { "pretty", "html:target/cucumber-html-report", @CucumberOptions(format = { "pretty", "html:target/cucumber-html-report",
{{#resourcePaths}} {{#resourcePaths}}
"json:./report/{{path}}-report-json/{{path}}.json", "json:./report/{{{path}}}-report-json/{{{path}}}.json",
{{/resourcePaths}} }) {{/resourcePaths}} })
public class {{serviceName}}Test { public class {{serviceName}}Test {
} }

View File

@ -24,9 +24,9 @@ public class ExecuteReport {
Configuration configuration = null; Configuration configuration = null;
ReportBuilder reportBuilder = null; ReportBuilder reportBuilder = null;
{{#resourcePaths}} {{#resourcePaths}}
reportOutputDirectory = new File("./report/{{path}}-report-html/"); reportOutputDirectory = new File("./report/{{{path}}}-report-html/");
jsonFiles = new ArrayList(); jsonFiles = new ArrayList();
jsonFiles.add("./report/{{path}}-report-json/{{path}}.json"); jsonFiles.add("./report/{{{path}}}-report-json/{{{path}}}.json");
configuration = new Configuration(reportOutputDirectory,projectName); configuration = new Configuration(reportOutputDirectory,projectName);
// optionally only if you need // optionally only if you need

View File

@ -9,7 +9,7 @@ import org.springframework.boot.SpringApplication
import org.springframework.context.ConfigurableApplicationContext import org.springframework.context.ConfigurableApplicationContext
class get{{path}} extends Simulation { class get{{{path}}} extends Simulation {
val app: ConfigurableApplicationContext = SpringApplication.run(classOf[{{basePackage}}.{{serviceName}}Application]) val app: ConfigurableApplicationContext = SpringApplication.run(classOf[{{basePackage}}.{{serviceName}}Application])

View File

@ -32,9 +32,9 @@ public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter
{{#resourcePaths}} {{#resourcePaths}}
http. http.
anonymous().disable() anonymous().disable()
.requestMatchers().antMatchers(HttpMethod.GET, "/{{path}}/**") .requestMatchers().antMatchers(HttpMethod.GET, "/{{{path}}}/**")
.and().authorizeRequests() .and().authorizeRequests()
.antMatchers(HttpMethod.GET, "/{{path}}/**").access("hasRole('ADMIN')") .antMatchers(HttpMethod.GET, "/{{{path}}}/**").access("hasRole('ADMIN')")
.and().exceptionHandling().accessDeniedHandler(new OAuth2AccessDeniedHandler()); .and().exceptionHandling().accessDeniedHandler(new OAuth2AccessDeniedHandler());
{{/resourcePaths}} {{/resourcePaths}}
} }

View File

@ -5,7 +5,7 @@
{{#vendorExtensions.requests}} {{#vendorExtensions.requests}}
### {{#summary}}{{summary}}{{/summary}} ### {{#summary}}{{summary}}{{/summary}}
## {{name}} ## {{name}}
{{httpMethod}} {{basePath}}{{#lambda.doubleMustache}}{{path}}{{/lambda.doubleMustache}}{{>queryParams}} {{httpMethod}} {{basePath}}{{#lambda.doubleMustache}}{{{path}}}{{/lambda.doubleMustache}}{{>queryParams}}
{{#consumes}} {{#consumes}}
Content-Type: {{{mediaType}}} Content-Type: {{{mediaType}}}
{{/consumes}} {{/consumes}}

View File

@ -46,7 +46,7 @@ function _oacinternal_{{operationId}}(_api::{{classname}}{{#allParams}}{{#requir
{{/hasValidation}} {{/hasValidation}}
{{/allParams}} {{/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}} {{#pathParams}}
OpenAPI.Clients.set_param(_ctx.path, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{paramName}}{{#isListContainer}}; collection_format="{{collectionFormat}}"{{/isListContainer}}) # type {{dataType}} OpenAPI.Clients.set_param(_ctx.path, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{paramName}}{{#isListContainer}}; collection_format="{{collectionFormat}}"{{/isListContainer}}) # type {{dataType}}
{{/pathParams}} {{/pathParams}}

View File

@ -61,7 +61,7 @@ end
function register{{classname}}(router::HTTP.Router, impl; path_prefix::String="", optional_middlewares...) function register{{classname}}(router::HTTP.Router, impl; path_prefix::String="", optional_middlewares...)
{{#operation}} {{#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}} {{/operation}}
return router return router
end end

View File

@ -10,7 +10,7 @@ The following server methods must be implemented:
{{#operations}} {{#operations}}
{{#operation}} {{#operation}}
- **{{operationId}}** - **{{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}} - *signature:* {{operationId}}(req::HTTP.Request{{#allParams}}{{#required}}, {{paramName}}::{{dataType}}{{/required}}{{/allParams}};{{#allParams}}{{^required}} {{paramName}}=nothing,{{/required}}{{/allParams}}) -> {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Nothing{{/returnType}}
{{/operation}} {{/operation}}
{{/operations}} {{/operations}}

View File

@ -23,7 +23,7 @@ fun main() {
{{#apis}} {{#apis}}
{{#operations}} {{#operations}}
{{#operation}} {{#operation}}
{{#lowercase}}{{httpMethod}}{{/lowercase}}("{{path}}", {{classname}}::{{operationId}}) {{#lowercase}}{{httpMethod}}{{/lowercase}}("{{{path}}}", {{classname}}::{{operationId}})
{{/operation}} {{/operation}}
{{/operations}} {{/operations}}

View File

@ -18,10 +18,10 @@ object Paths {
{{#allParams}}* @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{#allParams}}* @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}}*/ {{/allParams}}*/
{{#hasParams}} {{#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}}
{{^hasParams}} {{^hasParams}}
@Serializable @Resource("{{path}}") class {{operationId}} @Serializable @Resource("{{{path}}}") class {{operationId}}
{{/hasParams}} {{/hasParams}}
{{/operation}} {{/operation}}

View File

@ -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}} value = [{{#responses}}ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}::class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}}]){{/swagger1AnnotationLibrary}}
@RequestMapping( @RequestMapping(
method = [RequestMethod.{{httpMethod}}], 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}}, produces = [{{#vendorExtensions.x-accepts}}"{{{.}}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-accepts}}]{{/hasProduces}}{{#hasConsumes}},
consumes = "{{{vendorExtensions.x-content-type}}}"{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}, consumes = "{{{vendorExtensions.x-content-type}}}"{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}},
produces = [{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}]{{/hasProduces}}{{#hasConsumes}}, produces = [{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}]{{/hasProduces}}{{#hasConsumes}},

View File

@ -96,7 +96,7 @@ interface {{classname}} {
value = [{{#responses}}ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}::class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}}, {{/-last}}{{/responses}}]){{/swagger1AnnotationLibrary}} value = [{{#responses}}ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}::class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}}, {{/-last}}{{/responses}}]){{/swagger1AnnotationLibrary}}
@RequestMapping( @RequestMapping(
method = [RequestMethod.{{httpMethod}}], 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}}, produces = [{{#vendorExtensions.x-accepts}}"{{{.}}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-accepts}}]{{/hasProduces}}{{#hasConsumes}},
consumes = "{{{vendorExtensions.x-content-type}}}"{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}, consumes = "{{{vendorExtensions.x-content-type}}}"{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}},
produces = [{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}]{{/hasProduces}}{{#hasConsumes}}, produces = [{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}]{{/hasProduces}}{{#hasConsumes}},

View File

@ -33,7 +33,7 @@ open class {{classname}}Stubs(private val objectMapper: ObjectMapper) {
* @return A [{{operationIdCamelCase}}StubBuilder] to configure the response, and the final [MappingBuilder]. * @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 = 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}} {{#pathParams}}
.withPathParam("{{baseName}}", {{paramName}}) .withPathParam("{{baseName}}", {{paramName}})
{{/pathParams}} {{/pathParams}}

View File

@ -9,7 +9,7 @@
<p>{{description}}</p> <p>{{description}}</p>
{{#notes}}<p>{{.}}</p>{{/notes}} {{#notes}}<p>{{.}}</p>{{/notes}}
<h3 class="section">URL</h3> <h3 class="section">URL</h3>
<code>{{basePath}}{{path}}</code> <code>{{{basePath}}}{{{path}}}</code>
<h3 class="section">HTTP Method</h3> <h3 class="section">HTTP Method</h3>
<code>{{httpMethod}}</code> <code>{{httpMethod}}</code>
<h3 class="section">Response Type</h3> <h3 class="section">Response Type</h3>

View File

@ -36,7 +36,7 @@ class ApiClient extends OAGAC\AbstractApiClient
{{>api_arg_declaration {{>api_arg_declaration
}} ): ResponseInterface }} ): 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}} {{#headerParams.0}}
$request = $this->addCustomHeaders($request, $parameters); $request = $this->addCustomHeaders($request, $parameters);
{{/headerParams.0}} {{/headerParams.0}}

View File

@ -8,7 +8,7 @@
# {{pathPrefix}} # {{pathPrefix}}
{{#operation}} {{#operation}}
{{bundleAlias}}_{{pathPrefix}}_{{operationIdLowerCase}}: {{bundleAlias}}_{{pathPrefix}}_{{operationIdLowerCase}}:
path: {{path}} path: {{{path}}}
methods: [{{httpMethod}}] methods: [{{httpMethod}}]
defaults: defaults:
_controller: {{bundleAlias}}.controller.{{pathPrefix}}::{{operationId}}Action _controller: {{bundleAlias}}.controller.{{pathPrefix}}::{{operationId}}Action

View File

@ -1,5 +1,5 @@
{ {
"name": "{{path}}{{#isDeprecated}} (DEPRECATED){{/isDeprecated}}", "name": "{{{path}}}{{#isDeprecated}} (DEPRECATED){{/isDeprecated}}",
"description": "{{{notes}}}", "description": "{{{notes}}}",
"item": [ "item": [
{{#vendorExtensions.postmanRequests}} {{#vendorExtensions.postmanRequests}}
@ -27,7 +27,7 @@
} }
}, },
"url": { "url": {
"raw": "{{=<% %>=}}{{baseUrl}}<%={{ }}=%>{{path}}", "raw": "{{=<% %>=}}{{baseUrl}}<%={{ }}=%>{{{path}}}",
"host": [ "host": [
"{{=<% %>=}}{{baseUrl}}<%={{ }}=%>" "{{=<% %>=}}{{baseUrl}}<%={{ }}=%>"
], ],

View File

@ -38,7 +38,7 @@ for _, name, _ in pkgutil.iter_modules(ns_pkg.__path__, ns_pkg.__name__ + "."):
{{#operations}} {{#operations}}
{{#operation}} {{#operation}}
@router.{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}( @router.{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}(
"{{path}}", "{{{path}}}",
responses={ responses={
{{#responses}} {{#responses}}
{{code}}: {{=<% %>=}}{<%#dataType%>"model": <%dataType%>, "description": "<%message%>"<%/dataType%><%^dataType%>"description": "<%message%>"<%/dataType%>}<%={{ }}=%>, {{code}}: {{=<% %>=}}{<%#dataType%>"model": <%dataType%>, "description": "<%message%>"<%/dataType%><%^dataType%>"description": "<%message%>"<%/dataType%>}<%={{ }}=%>,

View File

@ -461,7 +461,7 @@
{{/bodyParams}} {{/bodyParams}}
{{/hasBodyParam}} {{/hasBodyParam}}
local_var_url_path <- "{{path}}" local_var_url_path <- "{{{path}}}"
{{#hasPathParams}} {{#hasPathParams}}
{{#pathParams}} {{#pathParams}}
if (!missing(`{{paramName}}`)) { if (!missing(`{{paramName}}`)) {

View File

@ -12,7 +12,7 @@ Rails.application.routes.draw do
{{#apis}} {{#apis}}
{{#operations}} {{#operations}}
{{#operation}} {{#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}} {{/operation}}
{{/operations}} {{/operations}}
{{/apis}} {{/apis}}

View File

@ -18,7 +18,7 @@ trait {{classname}} extends Service {
named("{{classname}}").withCalls( named("{{classname}}").withCalls(
{{#operations}} {{#operations}}
{{#operation}} {{#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}} {{/operation}}
{{/operations}} {{/operations}}
).withAutoAcl(true) ).withAutoAcl(true)

View File

@ -19,7 +19,7 @@ import {{import}}
class {{classname}}Controller @Inject()(cc: ControllerComponents, api: {{classname}}){{#supportAsync}}(implicit executionContext: ExecutionContext){{/supportAsync}} extends AbstractController(cc) { class {{classname}}Controller @Inject()(cc: ControllerComponents, api: {{classname}}){{#supportAsync}}(implicit executionContext: ExecutionContext){{/supportAsync}} extends AbstractController(cc) {
{{#operation}} {{#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}} {{#pathParams}}
{{#description}} {{#description}}
* @param {{paramName}} {{description}} * @param {{paramName}} {{description}}

View File

@ -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}}] 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}} {{/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 httpMethod = Method.{{httpMethod}}
val contentType = `Content-Type`(MediaType.`application/json`) 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}}] 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}} {{/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 httpMethod = Method.{{httpMethod}}
val contentType = `Content-Type`(MediaType.`application/json`) val contentType = `Content-Type`(MediaType.`application/json`)

View File

@ -102,7 +102,7 @@ open class {{classname}} {
guard let baseURL = self.transport.baseURL ?? self.baseURL else { guard let baseURL = self.transport.baseURL ?? self.baseURL else {
throw OpenAPITransportError.badURLError() throw OpenAPITransportError.badURLError()
} }
{{#pathParams}}{{#-last}}var{{/-last}}{{/pathParams}}{{^pathParams}}let{{/pathParams}} localVarPath = "{{path}}" {{#pathParams}}{{#-last}}var{{/-last}}{{/pathParams}}{{^pathParams}}let{{/pathParams}} localVarPath = "{{{path}}}"
{{#pathParams}} {{#pathParams}}
{{#required}}localVarPath = localVarPath.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: {{> toString}}){{/required}}{{^required}}if let {{paramName}} = {{paramName}} { localVarPath = localVarPath.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: {{> toString}}) } {{/required}} {{#required}}localVarPath = localVarPath.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: {{> toString}}){{/required}}{{^required}}if let {{paramName}} = {{paramName}} { localVarPath = localVarPath.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: {{> toString}}) } {{/required}}
{{/pathParams}} {{/pathParams}}

View File

@ -80,7 +80,7 @@ module.exports = {
{{/allParams}} {{/allParams}}
{{/isMultipart}} {{/isMultipart}}
const options = { const options = {
url: utils.replacePathParameters('{{basePath}}{{path}}'), url: utils.replacePathParameters('{{{basePath}}}{{{path}}}'),
method: '{{httpMethod}}', method: '{{httpMethod}}',
removeMissingValuesFrom: { params: true, body: true }, removeMissingValuesFrom: { params: true, body: true },
headers: { headers: {