From 35cda31c96d4ba689edb33cf514965fd9e382cc3 Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 22 Mar 2017 17:03:05 +0800 Subject: [PATCH 1/2] use unescaped path in api client templates --- .../src/main/resources/CsharpDotNet2/api.mustache | 2 +- .../swagger-codegen/src/main/resources/Groovy/api.mustache | 2 +- .../src/main/resources/Java/libraries/retrofit/api.mustache | 4 ++-- .../src/main/resources/Java/libraries/retrofit2/api.mustache | 2 +- .../main/resources/Javascript-Closure-Angular/api.mustache | 2 +- .../src/main/resources/TypeScript-Fetch/api.mustache | 2 +- .../src/main/resources/akka-scala/api.mustache | 2 +- .../swagger-codegen/src/main/resources/android/api.mustache | 2 +- .../src/main/resources/android/libraries/volley/api.mustache | 4 ++-- .../src/main/resources/asyncscala/api.mustache | 2 +- .../swagger-codegen/src/main/resources/bash/client.mustache | 4 ++-- .../src/main/resources/cpprest/api-source.mustache | 2 +- modules/swagger-codegen/src/main/resources/dart/api.mustache | 2 +- modules/swagger-codegen/src/main/resources/flash/api.mustache | 2 +- modules/swagger-codegen/src/main/resources/go/api.mustache | 2 +- .../swagger-codegen/src/main/resources/objc/api-body.mustache | 2 +- modules/swagger-codegen/src/main/resources/perl/api.mustache | 2 +- modules/swagger-codegen/src/main/resources/php/api.mustache | 4 ++-- .../swagger-codegen/src/main/resources/python/api.mustache | 2 +- .../src/main/resources/qt5cpp/api-body.mustache | 2 +- modules/swagger-codegen/src/main/resources/scala/api.mustache | 2 +- modules/swagger-codegen/src/main/resources/swift/api.mustache | 4 ++-- .../swagger-codegen/src/main/resources/swift3/api.mustache | 4 ++-- .../src/main/resources/typescript-angular/api.mustache | 4 ++-- .../src/main/resources/typescript-angular2/api.mustache | 2 +- .../src/main/resources/typescript-jquery/api.mustache | 2 +- .../src/main/resources/typescript-node/api.mustache | 2 +- 27 files changed, 34 insertions(+), 34 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/api.mustache b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/api.mustache index f1756813ef4..fc7583b182c 100644 --- a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/api.mustache +++ b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/api.mustache @@ -89,7 +89,7 @@ namespace {{packageName}}.Api if ({{paramName}} == null) throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{nickname}}"); {{/required}}{{/allParams}} - var path = "{{path}}"; + var path = "{{{path}}}"; path = path.Replace("{format}", "json"); {{#pathParams}}path = path.Replace("{" + "{{baseName}}" + "}", ApiClient.ParameterToString({{{paramName}}})); {{/pathParams}} diff --git a/modules/swagger-codegen/src/main/resources/Groovy/api.mustache b/modules/swagger-codegen/src/main/resources/Groovy/api.mustache index 9f82181d45e..4e6e46ebb7c 100644 --- a/modules/swagger-codegen/src/main/resources/Groovy/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Groovy/api.mustache @@ -19,7 +19,7 @@ class {{classname}} { {{#operation}} def {{operationId}} ({{#allParams}} {{{dataType}}} {{paramName}},{{/allParams}} Closure onSuccess, Closure onFailure) { // create path and map path parameters (TODO) - String resourcePath = "{{path}}" + String resourcePath = "{{{path}}}" // query params def queryParams = [:] diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/api.mustache index 9d2d003d4f4..5ff72917614 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/api.mustache @@ -32,7 +32,7 @@ public interface {{classname}} { */ {{#formParams}}{{#-first}} {{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} - @{{httpMethod}}("{{path}}") + @{{httpMethod}}("{{{path}}}") {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}} {{operationId}}({{^allParams}});{{/allParams}} {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}} );{{/hasMore}}{{/allParams}} @@ -47,7 +47,7 @@ public interface {{classname}} { */ {{#formParams}}{{#-first}} {{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} - @{{httpMethod}}("{{path}}") + @{{httpMethod}}("{{{path}}}") void {{operationId}}( {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}, {{/allParams}}Callback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> cb ); diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache index 1ce3dc62502..047c4931f01 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache @@ -46,7 +46,7 @@ public interface {{classname}} { {{/-first}} {{/prioritizedContentTypes}} {{/formParams}} - @{{httpMethod}}("{{path}}") + @{{httpMethod}}("{{{path}}}") {{^usePlay24WS}}{{^doNotUseRx}}Observable{{/doNotUseRx}}{{#doNotUseRx}}Call{{/doNotUseRx}}{{/usePlay24WS}}{{#usePlay24WS}}F.Promise{{#usePlay24WS}}>{{/usePlay24WS}} {{operationId}}({{^allParams}});{{/allParams}} {{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}} );{{/hasMore}}{{/allParams}} diff --git a/modules/swagger-codegen/src/main/resources/Javascript-Closure-Angular/api.mustache b/modules/swagger-codegen/src/main/resources/Javascript-Closure-Angular/api.mustache index 98e2f1c6713..8a164b9931a 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript-Closure-Angular/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript-Closure-Angular/api.mustache @@ -64,7 +64,7 @@ goog.require('{{import}}'); */ {{package}}.{{classname}}.prototype.{{nickname}} = function({{#allParams}}{{^required}}opt_{{/required}}{{paramName}}, {{/allParams}}opt_extraHttpRequestParams) { /** @const {string} */ - var path = this.basePath_ + '{{path}}'{{#pathParams}} + var path = this.basePath_ + '{{{path}}}'{{#pathParams}} .replace('{' + '{{baseName}}' + '}', String({{^required}}opt_{{/required}}{{paramName}})){{/pathParams}}; /** @type {!Object} */ diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache index cff69261239..c3a25710782 100644 --- a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache +++ b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache @@ -79,7 +79,7 @@ export const {{classname}}FetchParamCreator = { } {{/required}} {{/allParams}} - const baseUrl = `{{path}}`{{#pathParams}} + const baseUrl = `{{{path}}}`{{#pathParams}} .replace(`{${"{{baseName}}"}}`, `${ params["{{paramName}}"] }`){{/pathParams}}; let urlObj = url.parse(baseUrl, true); {{#hasQueryParams}} diff --git a/modules/swagger-codegen/src/main/resources/akka-scala/api.mustache b/modules/swagger-codegen/src/main/resources/akka-scala/api.mustache index 7983a41edf6..713f229748d 100644 --- a/modules/swagger-codegen/src/main/resources/akka-scala/api.mustache +++ b/modules/swagger-codegen/src/main/resources/akka-scala/api.mustache @@ -20,7 +20,7 @@ object {{classname}} { {{>javadoc}} {{/javadocRenderer}} def {{operationId}}({{>methodParameters}}): ApiRequest[{{>operationReturnType}}] = - ApiRequest[{{>operationReturnType}}](ApiMethods.{{httpMethod.toUpperCase}}, "{{basePath}}", "{{path}}", {{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}}{{^consumes}}"application/json"{{/consumes}}) + ApiRequest[{{>operationReturnType}}](ApiMethods.{{httpMethod.toUpperCase}}, "{{basePath}}", "{{{path}}}", {{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}}{{^consumes}}"application/json"{{/consumes}}) {{#authMethods}}{{#isApiKey}}.withApiKey(apiKey, "{{keyParamName}}", {{#isKeyInQuery}}QUERY{{/isKeyInQuery}}{{#isKeyInHeader}}HEADER{{/isKeyInHeader}}) {{/isApiKey}}{{#isBasic}}.withCredentials(basicAuth) {{/isBasic}}{{/authMethods}}{{#bodyParam}}.withBody({{paramName}}) diff --git a/modules/swagger-codegen/src/main/resources/android/api.mustache b/modules/swagger-codegen/src/main/resources/android/api.mustache index 5ddd06f90da..73896ceaa86 100644 --- a/modules/swagger-codegen/src/main/resources/android/api.mustache +++ b/modules/swagger-codegen/src/main/resources/android/api.mustache @@ -56,7 +56,7 @@ public class {{classname}} { {{/required}}{{/allParams}} // create path and map variables - String localVarPath = "{{path}}".replaceAll("\\{format\\}","json"){{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}", apiInvoker.escapeString({{{paramName}}}.toString())){{/pathParams}}; + String localVarPath = "{{{path}}}".replaceAll("\\{format\\}","json"){{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}", apiInvoker.escapeString({{{paramName}}}.toString())){{/pathParams}}; // query params List localVarQueryParams = new ArrayList(); diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache index cbcbc96e3b1..fbb6d10cc42 100644 --- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache +++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache @@ -66,7 +66,7 @@ public class {{classname}} { {{/allParams}} // create path and map variables - String path = "{{path}}"{{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}", apiInvoker.escapeString({{{paramName}}}.toString())){{/pathParams}}; + String path = "{{{path}}}"{{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}", apiInvoker.escapeString({{{paramName}}}.toString())){{/pathParams}}; // query params List queryParams = new ArrayList(); @@ -156,7 +156,7 @@ public class {{classname}} { {{/required}}{{/allParams}} // create path and map variables - String path = "{{path}}".replaceAll("\\{format\\}","json"){{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}", apiInvoker.escapeString({{{paramName}}}.toString())){{/pathParams}}; + String path = "{{{path}}}".replaceAll("\\{format\\}","json"){{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}", apiInvoker.escapeString({{{paramName}}}.toString())){{/pathParams}}; // query params List queryParams = new ArrayList(); diff --git a/modules/swagger-codegen/src/main/resources/asyncscala/api.mustache b/modules/swagger-codegen/src/main/resources/asyncscala/api.mustache index 4595c877299..3b823902094 100644 --- a/modules/swagger-codegen/src/main/resources/asyncscala/api.mustache +++ b/modules/swagger-codegen/src/main/resources/asyncscala/api.mustache @@ -14,7 +14,7 @@ class {{classname}}(client: TransportClient, config: SwaggerConfig) extends ApiC {{/required}}{{#required}}{{paramName}}: {{dataType}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}})(implicit reader: ClientResponseReader[{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}]{{#bodyParams}}, writer: RequestWriter[{{dataType}}]{{/bodyParams}}){{#returnType}}: Future[{{returnType}}]{{/returnType}}{{^returnType}}: Future[Unit]{{/returnType}} = { // create path and map variables - val path = (addFmt("{{path}}"){{#pathParams}} + val path = (addFmt("{{{path}}}"){{#pathParams}} replaceAll ("\\{" + "{{baseName}}" + "\\}",{{paramName}}.toString){{/pathParams}}) // query params diff --git a/modules/swagger-codegen/src/main/resources/bash/client.mustache b/modules/swagger-codegen/src/main/resources/bash/client.mustache index 5c567de2cb1..6ed2247b574 100644 --- a/modules/swagger-codegen/src/main/resources/bash/client.mustache +++ b/modules/swagger-codegen/src/main/resources/bash/client.mustache @@ -815,10 +815,10 @@ call_{{operationId}}() { local query_parameter_names=({{#queryParams}}{{baseName}}{{#hasMore}} {{/hasMore}}{{/queryParams}}) if [[ $force = false ]]; then - validate_request_parameters "{{basePathWithoutHost}}{{path}}" path_parameter_names query_parameter_names + validate_request_parameters "{{basePathWithoutHost}}{{{path}}}" path_parameter_names query_parameter_names fi - local path=$(build_request_path "{{basePathWithoutHost}}{{path}}" path_parameter_names query_parameter_names) + local path=$(build_request_path "{{basePathWithoutHost}}{{{path}}}" path_parameter_names query_parameter_names) local method="{{httpMethod}}" local headers_curl=$(header_arguments_to_curl) if [[ -n $header_accept ]]; then diff --git a/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache b/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache index 28f4861b9b6..2a35f85fa12 100644 --- a/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache +++ b/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache @@ -37,7 +37,7 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r {{/isContainer}}{{/isPrimitiveType}}{{/required}}{{/allParams}} std::shared_ptr apiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t path = U("{{path}}"); + utility::string_t path = U("{{{path}}}"); {{#pathParams}}boost::replace_all(path, U("{") U("{{baseName}}") U("}"), ApiClient::parameterToString({{{paramName}}})); {{/pathParams}} diff --git a/modules/swagger-codegen/src/main/resources/dart/api.mustache b/modules/swagger-codegen/src/main/resources/dart/api.mustache index f3c80aecc5b..dfeb6995f67 100644 --- a/modules/swagger-codegen/src/main/resources/dart/api.mustache +++ b/modules/swagger-codegen/src/main/resources/dart/api.mustache @@ -25,7 +25,7 @@ class {{classname}} { {{/allParams}} // create path and map variables - String path = "{{path}}".replaceAll("{format}","json"){{#pathParams}}.replaceAll("{" + "{{baseName}}" + "}", {{{paramName}}}.toString()){{/pathParams}}; + String path = "{{{path}}}".replaceAll("{format}","json"){{#pathParams}}.replaceAll("{" + "{{baseName}}" + "}", {{{paramName}}}.toString()){{/pathParams}}; // query params List queryParams = []; diff --git a/modules/swagger-codegen/src/main/resources/flash/api.mustache b/modules/swagger-codegen/src/main/resources/flash/api.mustache index 439eaed1629..50861591c40 100644 --- a/modules/swagger-codegen/src/main/resources/flash/api.mustache +++ b/modules/swagger-codegen/src/main/resources/flash/api.mustache @@ -36,7 +36,7 @@ public class {{classname}} extends SwaggerApi { */ public function {{nickname}} ({{#allParams}}{{paramName}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): String { // create path and map variables - var path: String = "{{path}}".replace(/{format}/g,"xml"){{#pathParams}}.replace("{" + "{{baseName}}" + "}", getApiInvoker().escapeString({{{paramName}}})){{/pathParams}}; + var path: String = "{{{path}}}".replace(/{format}/g,"xml"){{#pathParams}}.replace("{" + "{{baseName}}" + "}", getApiInvoker().escapeString({{{paramName}}})){{/pathParams}}; // query params var queryParams: Dictionary = new Dictionary(); diff --git a/modules/swagger-codegen/src/main/resources/go/api.mustache b/modules/swagger-codegen/src/main/resources/go/api.mustache index 37d9ac7e6dc..7c2e31ecd41 100644 --- a/modules/swagger-codegen/src/main/resources/go/api.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api.mustache @@ -41,7 +41,7 @@ func (a {{{classname}}}) {{{nickname}}}({{#allParams}}{{paramName}} {{{dataType} var localVarHttpMethod = strings.ToUpper("{{httpMethod}}") // create path and map variables - localVarPath := a.Configuration.BasePath + "{{path}}"{{#pathParams}} + localVarPath := a.Configuration.BasePath + "{{{path}}}"{{#pathParams}} localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", fmt.Sprintf("%v", {{paramName}}), -1){{/pathParams}} localVarHeaderParams := make(map[string]string) diff --git a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache index 6f5ce7267fa..c9afce2f27a 100644 --- a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache @@ -77,7 +77,7 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513; {{/required}} {{/allParams}} - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"{{path}}"]; + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"{{{path}}}"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; {{#pathParams}} diff --git a/modules/swagger-codegen/src/main/resources/perl/api.mustache b/modules/swagger-codegen/src/main/resources/perl/api.mustache index d7b17fb9d8a..70e532ee82e 100644 --- a/modules/swagger-codegen/src/main/resources/perl/api.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/api.mustache @@ -78,7 +78,7 @@ sub {{operationId}} { {{/required}} {{/allParams}} # parse inputs - my $_resource_path = '{{path}}'; + my $_resource_path = '{{{path}}}'; my $_method = '{{httpMethod}}'; my $query_params = {}; diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index 2c0e2acb7f0..6619f8da8c1 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -163,7 +163,7 @@ use \{{invokerPackage}}\ObjectSerializer; {{/hasValidation}} {{/allParams}} // parse inputs - $resourcePath = "{{path}}"; + $resourcePath = "{{{path}}}"; $httpBody = ''; $queryParams = []; $headerParams = []; @@ -276,7 +276,7 @@ use \{{invokerPackage}}\ObjectSerializer; {{^returnType}} null, {{/returnType}} - '{{path}}' + '{{{path}}}' ); {{#returnType}} diff --git a/modules/swagger-codegen/src/main/resources/python/api.mustache b/modules/swagger-codegen/src/main/resources/python/api.mustache index a8a0563b295..77c17a2ef55 100644 --- a/modules/swagger-codegen/src/main/resources/python/api.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api.mustache @@ -210,7 +210,7 @@ class {{classname}}(object): # Authentication setting auth_settings = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] - return self.api_client.call_api('{{path}}', '{{httpMethod}}', + return self.api_client.call_api('{{{path}}}', '{{httpMethod}}', path_params, query_params, header_params, diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache index 53922482854..e0644395403 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache @@ -21,7 +21,7 @@ namespace Swagger { void {{classname}}::{{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { QString fullPath; - fullPath.append(this->host).append(this->basePath).append("{{path}}"); + fullPath.append(this->host).append(this->basePath).append("{{{path}}}"); {{#pathParams}} QString {{paramName}}PathParam("{"); {{paramName}}PathParam.append("{{baseName}}").append("}"); diff --git a/modules/swagger-codegen/src/main/resources/scala/api.mustache b/modules/swagger-codegen/src/main/resources/scala/api.mustache index 177fc96cd13..e1ce48568ee 100644 --- a/modules/swagger-codegen/src/main/resources/scala/api.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/api.mustache @@ -33,7 +33,7 @@ class {{classname}}(val defBasePath: String = "{{basePath}}", */ def {{operationId}}({{#allParams}}{{paramName}}: {{#required}}{{dataType}}{{#defaultValue}} /* = {{{defaultValue}}}*/{{/defaultValue}}{{/required}}{{^required}}Option[{{dataType}}]{{#defaultValue}} /* = {{{defaultValue}}}*/{{/defaultValue}}{{^defaultValue}} = None{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}: Option[{{returnType}}]{{/returnType}} = { // create path and map variables - val path = "{{path}}".replaceAll("\\{format\\}", "json"){{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}",apiInvoker.escape({{paramName}})){{/pathParams}} + val path = "{{{path}}}".replaceAll("\\{format\\}", "json"){{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}",apiInvoker.escape({{paramName}})){{/pathParams}} val contentTypes = List({{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}"application/json"{{/consumes}}) val contentType = contentTypes(0) diff --git a/modules/swagger-codegen/src/main/resources/swift/api.mustache b/modules/swagger-codegen/src/main/resources/swift/api.mustache index c339c4433d8..77debc91652 100644 --- a/modules/swagger-codegen/src/main/resources/swift/api.mustache +++ b/modules/swagger-codegen/src/main/resources/swift/api.mustache @@ -90,7 +90,7 @@ public class {{classname}}: APIBase { {{#summary}} {{{summary}}} {{/summary}} - - {{httpMethod}} {{path}}{{#notes}} + - {{httpMethod}} {{{path}}}{{#notes}} - {{{notes}}}{{/notes}}{{#subresourceOperation}} - subresourceOperation: {{subresourceOperation}}{{/subresourceOperation}}{{#defaultResponse}} - defaultResponse: {{defaultResponse}}{{/defaultResponse}}{{#authMethods}} @@ -106,7 +106,7 @@ public class {{classname}}: APIBase { - returns: RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{description}} */ public class func {{operationId}}WithRequestBuilder({{#allParams}}{{^secondaryParam}}{{paramName}} {{/secondaryParam}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { - {{^pathParams}}let{{/pathParams}}{{#pathParams}}{{^secondaryParam}}var{{/secondaryParam}}{{/pathParams}} path = "{{path}}"{{#pathParams}} + {{^pathParams}}let{{/pathParams}}{{#pathParams}}{{^secondaryParam}}var{{/secondaryParam}}{{/pathParams}} path = "{{{path}}}"{{#pathParams}} path = path.stringByReplacingOccurrencesOfString("{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", withString: "\({{paramName}}{{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}})", options: .LiteralSearch, range: nil){{/pathParams}} let URLString = {{projectName}}API.basePath + path {{#bodyParam}} diff --git a/modules/swagger-codegen/src/main/resources/swift3/api.mustache b/modules/swagger-codegen/src/main/resources/swift3/api.mustache index 89768cd5832..495762a46a9 100644 --- a/modules/swagger-codegen/src/main/resources/swift3/api.mustache +++ b/modules/swagger-codegen/src/main/resources/swift3/api.mustache @@ -88,7 +88,7 @@ open class {{classname}}: APIBase { {{#summary}} {{{summary}}} {{/summary}} - - {{httpMethod}} {{path}}{{#notes}} + - {{httpMethod}} {{{path}}}{{#notes}} - {{{notes}}}{{/notes}}{{#subresourceOperation}} - subresourceOperation: {{subresourceOperation}}{{/subresourceOperation}}{{#defaultResponse}} - defaultResponse: {{defaultResponse}}{{/defaultResponse}}{{#authMethods}} @@ -104,7 +104,7 @@ open class {{classname}}: APIBase { - returns: RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{description}} */ open class func {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { - {{^pathParams}}let{{/pathParams}}{{#pathParams}}{{^secondaryParam}}var{{/secondaryParam}}{{/pathParams}} path = "{{path}}"{{#pathParams}} + {{^pathParams}}let{{/pathParams}}{{#pathParams}}{{^secondaryParam}}var{{/secondaryParam}}{{/pathParams}} path = "{{{path}}}"{{#pathParams}} path = path.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: "\({{paramName}}{{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}})", options: .literal, range: nil){{/pathParams}} let URLString = {{projectName}}API.basePath + path {{#bodyParam}} diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.mustache index f73752f7df5..08d609dd88e 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/api.mustache @@ -28,7 +28,7 @@ export class {{classname}} { {{#allParams}}* @param {{paramName}} {{description}} {{/allParams}}*/ public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any ) : ng.IHttpPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}> { - const localVarPath = this.basePath + '{{path}}'{{#pathParams}} + const localVarPath = this.basePath + '{{{path}}}'{{#pathParams}} .replace('{' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}}; let queryParameters: any = {}; @@ -82,4 +82,4 @@ export class {{classname}} { } {{/operation}} } -{{/operations}} \ No newline at end of file +{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache index 2ac0497cacf..91de00670c5 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache @@ -61,7 +61,7 @@ export class {{classname}} { {{#allParams}}* @param {{paramName}} {{description}} {{/allParams}}*/ public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any): Observable { - const path = this.basePath + '{{path}}'{{#pathParams}} + const path = this.basePath + '{{{path}}}'{{#pathParams}} .replace('${' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}}; let queryParameters = new URLSearchParams(); diff --git a/modules/swagger-codegen/src/main/resources/typescript-jquery/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-jquery/api.mustache index 9649528630b..974c7219508 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-jquery/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-jquery/api.mustache @@ -183,7 +183,7 @@ export class {{classname}} { {{#allParams}}* @param {{paramName}} {{description}} {{/allParams}}*/ public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : JQueryPromise<{ response: JQueryXHR; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }> { - let localVarPath = this.basePath + '{{path}}'{{#pathParams}} + let localVarPath = this.basePath + '{{{path}}}'{{#pathParams}} .replace('{' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}}; let queryParameters: any = {}; let headerParams: any = this.extendObj({}, this.defaultHeaders); diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache index 7fe4c99ad8e..25fcdbde75d 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache @@ -190,7 +190,7 @@ export class {{classname}} { {{#allParams}}* @param {{paramName}} {{description}} {{/allParams}}*/ public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : Promise<{ response: http.{{#supportsES6}}IncomingMessage{{/supportsES6}}{{^supportsES6}}ClientResponse{{/supportsES6}}; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }> { - const localVarPath = this.basePath + '{{path}}'{{#pathParams}} + const localVarPath = this.basePath + '{{{path}}}'{{#pathParams}} .replace('{' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}}; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); From 3b11431ca0d1e4e49a164863087ec122dd36e51a Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 22 Mar 2017 17:27:26 +0800 Subject: [PATCH 2/2] use unescape basePath in API client templates --- .../src/main/resources/CsharpDotNet2/ApiClient.mustache | 2 +- .../swagger-codegen/src/main/resources/Groovy/api.mustache | 2 +- .../src/main/resources/Java/ApiClient.mustache | 2 +- .../main/resources/Javascript-Closure-Angular/api.mustache | 2 +- .../src/main/resources/Javascript/ApiClient.mustache | 4 ++-- .../src/main/resources/akka-scala/api.mustache | 2 +- .../swagger-codegen/src/main/resources/android/api.mustache | 2 +- .../src/main/resources/android/libraries/volley/api.mustache | 2 +- .../swagger-codegen/src/main/resources/elixir/api.mustache | 2 +- .../main/resources/objc/DefaultConfiguration-body.mustache | 2 +- .../src/main/resources/perl/ApiClient.mustache | 2 +- .../src/main/resources/php/configuration.mustache | 2 +- .../src/main/resources/python/configuration.mustache | 2 +- modules/swagger-codegen/src/main/resources/scala/api.mustache | 2 +- .../swagger-codegen/src/main/resources/swift/APIs.mustache | 2 +- .../swagger-codegen/src/main/resources/swift3/APIs.mustache | 2 +- .../src/main/resources/tizen/api-header.mustache | 2 +- .../src/main/resources/typescript-angular/api.mustache | 2 +- .../src/main/resources/typescript-jquery/api.mustache | 2 +- .../src/main/resources/typescript-node/api.mustache | 2 +- 20 files changed, 21 insertions(+), 21 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/ApiClient.mustache index ea92989daa4..c46667c61f8 100644 --- a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/ApiClient.mustache @@ -24,7 +24,7 @@ namespace {{packageName}}.Client /// Initializes a new instance of the class. /// /// The base path. - public ApiClient(String basePath="{{basePath}}") + public ApiClient(String basePath="{{{basePath}}}") { BasePath = basePath; RestClient = new RestClient(BasePath); diff --git a/modules/swagger-codegen/src/main/resources/Groovy/api.mustache b/modules/swagger-codegen/src/main/resources/Groovy/api.mustache index 4e6e46ebb7c..3548311eb86 100644 --- a/modules/swagger-codegen/src/main/resources/Groovy/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Groovy/api.mustache @@ -13,7 +13,7 @@ import java.util.*; @Mixin(ApiUtils) {{#operations}} class {{classname}} { - String basePath = "{{basePath}}" + String basePath = "{{{basePath}}}" String versionPath = "/api/v1" {{#operation}} diff --git a/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache index dac15cd9f83..be339eca404 100644 --- a/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache @@ -50,7 +50,7 @@ import {{invokerPackage}}.auth.OAuth; {{>generatedAnnotation}} public class ApiClient { private Map defaultHeaderMap = new HashMap(); - private String basePath = "{{basePath}}"; + private String basePath = "{{{basePath}}}"; private boolean debugging = false; private int connectionTimeout = 0; diff --git a/modules/swagger-codegen/src/main/resources/Javascript-Closure-Angular/api.mustache b/modules/swagger-codegen/src/main/resources/Javascript-Closure-Angular/api.mustache index 8a164b9931a..069668e480c 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript-Closure-Angular/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript-Closure-Angular/api.mustache @@ -38,7 +38,7 @@ goog.require('{{import}}'); /** @private {!string} */ this.basePath_ = $injector.has('{{classname}}BasePath') ? /** @type {!string} */ ($injector.get('{{classname}}BasePath')) : - '{{basePath}}'; + '{{{basePath}}}'; /** @private {!Object} */ this.defaultHeaders_ = $injector.has('{{classname}}DefaultHeaders') ? diff --git a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache index e5af8ff80a5..a07b3366a69 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache @@ -32,9 +32,9 @@ {{#emitJSDoc}} /** * The base URL against which to resolve every API call's (relative) path. * @type {String} - * @default {{basePath}} + * @default {{{basePath}}} */ -{{/emitJSDoc}} this.basePath = '{{basePath}}'.replace(/\/+$/, ''); +{{/emitJSDoc}} this.basePath = '{{{basePath}}}'.replace(/\/+$/, ''); {{#emitJSDoc}} /** * The authentication methods to be included for all API calls. diff --git a/modules/swagger-codegen/src/main/resources/akka-scala/api.mustache b/modules/swagger-codegen/src/main/resources/akka-scala/api.mustache index 713f229748d..38401a7a8a5 100644 --- a/modules/swagger-codegen/src/main/resources/akka-scala/api.mustache +++ b/modules/swagger-codegen/src/main/resources/akka-scala/api.mustache @@ -20,7 +20,7 @@ object {{classname}} { {{>javadoc}} {{/javadocRenderer}} def {{operationId}}({{>methodParameters}}): ApiRequest[{{>operationReturnType}}] = - ApiRequest[{{>operationReturnType}}](ApiMethods.{{httpMethod.toUpperCase}}, "{{basePath}}", "{{{path}}}", {{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}}{{^consumes}}"application/json"{{/consumes}}) + ApiRequest[{{>operationReturnType}}](ApiMethods.{{httpMethod.toUpperCase}}, "{{{basePath}}}", "{{{path}}}", {{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}}{{^consumes}}"application/json"{{/consumes}}) {{#authMethods}}{{#isApiKey}}.withApiKey(apiKey, "{{keyParamName}}", {{#isKeyInQuery}}QUERY{{/isKeyInQuery}}{{#isKeyInHeader}}HEADER{{/isKeyInHeader}}) {{/isApiKey}}{{#isBasic}}.withCredentials(basicAuth) {{/isBasic}}{{/authMethods}}{{#bodyParam}}.withBody({{paramName}}) diff --git a/modules/swagger-codegen/src/main/resources/android/api.mustache b/modules/swagger-codegen/src/main/resources/android/api.mustache index 73896ceaa86..5d8cdd330db 100644 --- a/modules/swagger-codegen/src/main/resources/android/api.mustache +++ b/modules/swagger-codegen/src/main/resources/android/api.mustache @@ -20,7 +20,7 @@ import java.io.File; {{#operations}} public class {{classname}} { - String basePath = "{{basePath}}"; + String basePath = "{{{basePath}}}"; ApiInvoker apiInvoker = ApiInvoker.getInstance(); public void addHeader(String key, String value) { diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache index fbb6d10cc42..7aa3bef6538 100644 --- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache +++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache @@ -27,7 +27,7 @@ import java.util.concurrent.TimeoutException; {{#operations}} public class {{classname}} { - String basePath = "{{basePath}}"; + String basePath = "{{{basePath}}}"; ApiInvoker apiInvoker = ApiInvoker.getInstance(); public void addHeader(String key, String value) { diff --git a/modules/swagger-codegen/src/main/resources/elixir/api.mustache b/modules/swagger-codegen/src/main/resources/elixir/api.mustache index d748076c69f..7a10537b5fa 100644 --- a/modules/swagger-codegen/src/main/resources/elixir/api.mustache +++ b/modules/swagger-codegen/src/main/resources/elixir/api.mustache @@ -5,7 +5,7 @@ defmodule {{#modulized}}{{appName}}{{/modulized}}.Api.{{classname}} do use Tesla - plug Tesla.Middleware.BaseUrl, "{{basePath}}" + plug Tesla.Middleware.BaseUrl, "{{{basePath}}}" plug Tesla.Middleware.JSON {{#operations}} {{#operation}} diff --git a/modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-body.mustache b/modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-body.mustache index 548383a7e1e..ce336e66171 100644 --- a/modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-body.mustache @@ -28,7 +28,7 @@ - (instancetype) init { self = [super init]; if (self) { - _host = @"{{basePath}}"; + _host = @"{{{basePath}}}"; _username = @""; _password = @""; _accessToken= @""; diff --git a/modules/swagger-codegen/src/main/resources/perl/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/perl/ApiClient.mustache index 4da9f8fb41e..e5f12ca0bec 100644 --- a/modules/swagger-codegen/src/main/resources/perl/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/ApiClient.mustache @@ -33,7 +33,7 @@ sub _new_instance my $class = shift; my (%args) = ( 'ua' => LWP::UserAgent->new, - 'base_url' => '{{basePath}}', + 'base_url' => '{{{basePath}}}', @_ ); diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index bc3548a5019..4e10f33823c 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -78,7 +78,7 @@ class Configuration * * @var string */ - protected $host = '{{basePath}}'; + protected $host = '{{{basePath}}}'; /** * Timeout (second) of the HTTP request, by default set to 0, no timeout diff --git a/modules/swagger-codegen/src/main/resources/python/configuration.mustache b/modules/swagger-codegen/src/main/resources/python/configuration.mustache index b3961009f16..47c7db9fbad 100644 --- a/modules/swagger-codegen/src/main/resources/python/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/python/configuration.mustache @@ -36,7 +36,7 @@ class Configuration(object): Constructor """ # Default Base url - self.host = "{{basePath}}" + self.host = "{{{basePath}}}" # Default api client self.api_client = None # Temp file folder for downloading files diff --git a/modules/swagger-codegen/src/main/resources/scala/api.mustache b/modules/swagger-codegen/src/main/resources/scala/api.mustache index e1ce48568ee..c3dd3effe7d 100644 --- a/modules/swagger-codegen/src/main/resources/scala/api.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/api.mustache @@ -17,7 +17,7 @@ import java.util.Date import scala.collection.mutable.HashMap {{#operations}} -class {{classname}}(val defBasePath: String = "{{basePath}}", +class {{classname}}(val defBasePath: String = "{{{basePath}}}", defApiInvoker: ApiInvoker = ApiInvoker) { var basePath = defBasePath var apiInvoker = defApiInvoker diff --git a/modules/swagger-codegen/src/main/resources/swift/APIs.mustache b/modules/swagger-codegen/src/main/resources/swift/APIs.mustache index e16e45b1a18..e6f6e82479a 100644 --- a/modules/swagger-codegen/src/main/resources/swift/APIs.mustache +++ b/modules/swagger-codegen/src/main/resources/swift/APIs.mustache @@ -7,7 +7,7 @@ import Foundation public class {{projectName}}API { - public static var basePath = "{{basePath}}" + public static var basePath = "{{{basePath}}}" public static var credential: NSURLCredential? public static var customHeaders: [String:String] = [:] static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() diff --git a/modules/swagger-codegen/src/main/resources/swift3/APIs.mustache b/modules/swagger-codegen/src/main/resources/swift3/APIs.mustache index 2d4c40266c0..1ce9e02e4dd 100644 --- a/modules/swagger-codegen/src/main/resources/swift3/APIs.mustache +++ b/modules/swagger-codegen/src/main/resources/swift3/APIs.mustache @@ -7,7 +7,7 @@ import Foundation open class {{projectName}}API { - open static var basePath = "{{basePath}}" + open static var basePath = "{{{basePath}}}" open static var credential: URLCredential? open static var customHeaders: [String:String] = [:] static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() diff --git a/modules/swagger-codegen/src/main/resources/tizen/api-header.mustache b/modules/swagger-codegen/src/main/resources/tizen/api-header.mustache index 2a1daf95158..930f88c21e6 100644 --- a/modules/swagger-codegen/src/main/resources/tizen/api-header.mustache +++ b/modules/swagger-codegen/src/main/resources/tizen/api-header.mustache @@ -23,7 +23,7 @@ public: {{nickname}}WithCompletion({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}},{{/hasParams}} {{#returnType}}void (* handler)({{returnType}}, {{prefix}}Error*){{/returnType}}{{^returnType}}void(* handler)({{prefix}}Error*){{/returnType}}); {{/operation}} static String getBasePath() { - return L"{{basePath}}"; + return L"{{{basePath}}}"; } private: diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.mustache index 08d609dd88e..8fc8ca79941 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/api.mustache @@ -10,7 +10,7 @@ import * as models from '../model/models'; */ {{/description}} export class {{classname}} { - protected basePath = '{{basePath}}'; + protected basePath = '{{{basePath}}}'; public defaultHeaders : any = {}; static $inject: string[] = ['$http', '$httpParamSerializer', 'basePath']; diff --git a/modules/swagger-codegen/src/main/resources/typescript-jquery/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-jquery/api.mustache index 974c7219508..8469672d2fe 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-jquery/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-jquery/api.mustache @@ -1,6 +1,6 @@ import * as $ from 'jquery'; -let defaultBasePath = '{{basePath}}'; +let defaultBasePath = '{{{basePath}}}'; // =============================================== // This file is autogenerated - Please do not edit diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache index 25fcdbde75d..0a9d023c31a 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache @@ -5,7 +5,7 @@ import http = require('http'); import Promise = require('bluebird'); {{/supportsES6}} -let defaultBasePath = '{{basePath}}'; +let defaultBasePath = '{{{basePath}}}'; // =============================================== // This file is autogenerated - Please do not edit