Skip to content

Use unescaped path in API client templates #5154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace {{packageName}}.Client
/// Initializes a new instance of the <see cref="ApiClient" /> class.
/// </summary>
/// <param name="basePath">The base path.</param>
public ApiClient(String basePath="{{basePath}}")
public ApiClient(String basePath="{{{basePath}}}")
{
BasePath = basePath;
RestClient = new RestClient(BasePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import java.util.*;
@Mixin(ApiUtils)
{{#operations}}
class {{classname}} {
String basePath = "{{basePath}}"
String basePath = "{{{basePath}}}"
String versionPath = "/api/v1"

{{#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 = [:]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import {{invokerPackage}}.auth.OAuth;
{{>generatedAnnotation}}
public class ApiClient {
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
private String basePath = "{{basePath}}";
private String basePath = "{{{basePath}}}";
private boolean debugging = false;
private int connectionTimeout = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand All @@ -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
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Response{{/usePlay24WS}}<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>{{#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}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string>} */
this.defaultHeaders_ = $injector.has('{{classname}}DefaultHeaders') ?
Expand All @@ -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} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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<Pair> localVarQueryParams = new ArrayList<Pair>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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<Pair> queryParams = new ArrayList<Pair>();
Expand Down Expand Up @@ -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<Pair> queryParams = new ArrayList<Pair>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r
{{/isContainer}}{{/isPrimitiveType}}{{/required}}{{/allParams}}

std::shared_ptr<ApiConfiguration> 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}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<QueryParam> queryParams = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion modules/swagger-codegen/src/main/resources/go/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
- (instancetype) init {
self = [super init];
if (self) {
_host = @"{{basePath}}";
_host = @"{{{basePath}}}";
_username = @"";
_password = @"";
_accessToken= @"";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sub _new_instance
my $class = shift;
my (%args) = (
'ua' => LWP::UserAgent->new,
'base_url' => '{{basePath}}',
'base_url' => '{{{basePath}}}',
@_
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ sub {{operationId}} {
{{/required}}
{{/allParams}}
# parse inputs
my $_resource_path = '{{path}}';
my $_resource_path = '{{{path}}}';

my $_method = '{{httpMethod}}';
my $query_params = {};
Expand Down
4 changes: 2 additions & 2 deletions modules/swagger-codegen/src/main/resources/php/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ use \{{invokerPackage}}\ObjectSerializer;
{{/hasValidation}}
{{/allParams}}
// parse inputs
$resourcePath = "{{path}}";
$resourcePath = "{{{path}}}";
$httpBody = '';
$queryParams = [];
$headerParams = [];
Expand Down Expand Up @@ -276,7 +276,7 @@ use \{{invokerPackage}}\ObjectSerializer;
{{^returnType}}
null,
{{/returnType}}
'{{path}}'
'{{{path}}}'
);

{{#returnType}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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("}");
Expand Down
4 changes: 2 additions & 2 deletions modules/swagger-codegen/src/main/resources/scala/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions modules/swagger-codegen/src/main/resources/swift/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand All @@ -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}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading