Skip to content
Open
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 @@ -66,7 +66,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}}
.replace('{' + '{{baseName}}' + '}', String({{^required}}opt_{{/required}}{{paramName}})){{/pathParams}};
.replace({{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>, String({{^required}}opt_{{/required}}{{paramName}})){{/pathParams}};

/** @type {!Object} */
var queryParameters = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class {{classname}} {
method: '{{httpMethod}}',
url: this.basePath + '{{{path}}}'
{{#pathParams}}
.replace('{' + '{{baseName}}' + '}', ':{{paramName}}')
.replace({{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>, ':{{paramName}}')
{{/pathParams}}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur
{{/required}}
{{/allParams}}
const localVarPath = `{{{path}}}`{{#pathParams}}
.replace(`{${"{{baseName}}"}}`, encodeURIComponent(String({{paramName}}))){{/pathParams}};
.replace({{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>, encodeURIComponent(String({{paramName}}))){{/pathParams}};
const localVarUrlObj = url.parse(localVarPath, true);
const localVarRequestOptions: RequestOptions = Object.assign({}, { method: '{{httpMethod}}' }, options);
const localVarHeaderParameter = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ use {{invokerPackage}}\ObjectSerializer;
{{/collectionFormat}}
if (${{paramName}} !== null) {
$resourcePath = str_replace(
'{' . '{{baseName}}' . '}',
{{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>,
ObjectSerializer::toPathValue(${{paramName}}{{#isEnumRef}}->value{{/isEnumRef}}),
$resourcePath
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ use {{invokerPackage}}\ObjectSerializer;
{{/collectionFormat}}
if (${{paramName}} !== null) {
$resourcePath = str_replace(
'{' . '{{baseName}}' . '}',
{{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>,
ObjectSerializer::toPathValue(${{paramName}}),
$resourcePath
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ use function sprintf;
{{/collectionFormat}}
if (${{paramName}} !== null) {
$resourcePath = str_replace(
'{' . '{{baseName}}' . '}',
{{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>,
ObjectSerializer::toPathValue(${{paramName}}),
$resourcePath
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ module {{moduleName}}
{{/hasValidation}}
{{/allParams}}
# resource path
local_var_path = '{{{path}}}'{{#pathParams}}.sub('{' + '{{baseName}}' + '}', CGI.escape({{paramName}}.to_s){{^strictSpecBehavior}}.gsub('%2F', '/'){{/strictSpecBehavior}}){{/pathParams}}
local_var_path = '{{{path}}}'{{#pathParams}}.sub({{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>, CGI.escape({{paramName}}.to_s){{^strictSpecBehavior}}.gsub('%2F', '/'){{/strictSpecBehavior}}){{/pathParams}}

# query parameters
query_params = opts[:query_params] || {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class {{classname}} {
*/
public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any ) : ng.IHttpPromise<{{{returnType}}}{{^returnType}}{}{{/returnType}}> {
const localVarPath = this.basePath + '{{{path}}}'{{#pathParams}}
.replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}};
.replace({{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>, encodeURIComponent(String({{paramName}}))){{/pathParams}};

let queryParameters: any = {};
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur
{{/required}}
{{/allParams}}
const localVarPath = `{{{path}}}`{{#pathParams}}
.replace(`{${"{{baseName}}"}}`, encodeURIComponent(String({{paramName}}))){{/pathParams}};
.replace({{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>, encodeURIComponent(String({{paramName}}))){{/pathParams}};
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,21 +295,21 @@ export class {{classname}} extends runtime.BaseAPI {
{{#pathParams}}
{{#isDateTimeType}}
if (requestParameters['{{paramName}}'] instanceof Date) {
urlPath = urlPath.replace(`{${"{{baseName}}"}}`, encodeURIComponent(requestParameters['{{paramName}}'].toISOString()));
urlPath = urlPath.replace({{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>, encodeURIComponent(requestParameters['{{paramName}}'].toISOString()));
} else {
urlPath = urlPath.replace(`{${"{{baseName}}"}}`, encodeURIComponent(String(requestParameters['{{paramName}}'])));
urlPath = urlPath.replace({{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>, encodeURIComponent(String(requestParameters['{{paramName}}'])));
}
{{/isDateTimeType}}
{{^isDateTimeType}}
{{#isDateType}}
if (requestParameters['{{paramName}}'] instanceof Date) {
urlPath = urlPath.replace(`{${"{{baseName}}"}}`, encodeURIComponent(requestParameters['{{paramName}}'].toISOString().substring(0,10)));
urlPath = urlPath.replace({{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>, encodeURIComponent(requestParameters['{{paramName}}'].toISOString().substring(0,10)));
} else {
urlPath = urlPath.replace(`{${"{{baseName}}"}}`, encodeURIComponent(String(requestParameters['{{paramName}}'])));
urlPath = urlPath.replace({{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>, encodeURIComponent(String(requestParameters['{{paramName}}'])));
}
{{/isDateType}}
{{^isDateType}}
urlPath = urlPath.replace(`{${"{{baseName}}"}}`, encodeURIComponent(String(requestParameters['{{paramName}}'])));
urlPath = urlPath.replace({{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>, encodeURIComponent(String(requestParameters['{{paramName}}'])));
{{/isDateType}}
{{/isDateTimeType}}
{{/pathParams}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class {{classname}} {
{ response: JQueryXHR; {{#returnType}}body: {{{.}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} },
{ response: JQueryXHR; errorThrown: string }
> {
let localVarPath = this.basePath + '{{{path}}}'{{#pathParams}}.replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}};
let localVarPath = this.basePath + '{{{path}}}'{{#pathParams}}.replace({{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>, encodeURIComponent(String({{paramName}}))){{/pathParams}};

let queryParameters: any = {};
let headerParams: any = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class {{classname}} {
*/
public async {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; {{#returnType}}body: {{{.}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }> {
const localVarPath = this.basePath + '{{{path}}}'{{#pathParams}}
.replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}};
.replace({{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>, encodeURIComponent(String({{paramName}}))){{/pathParams}};
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
{{#hasProduces}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function {{nickname}}Raw<T>({{#allParams.0}}requestParameters: {{operationIdCame
{{/isArray}}
{{/formParams}}
const config: QueryConfig<T> = {
url: `${runtime.Configuration.basePath}{{{path}}}`{{#pathParams}}.replace(`{${"{{baseName}}"}}`, encodeURIComponent(String(requestParameters.{{paramName}}))){{/pathParams}},
url: `${runtime.Configuration.basePath}{{{path}}}`{{#pathParams}}.replace({{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>, encodeURIComponent(String(requestParameters.{{paramName}}))){{/pathParams}},
meta,
update: requestConfig.update,
queryKey: requestConfig.queryKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {

// Path Params
const localVarPath = '{{{path}}}'{{#pathParams}}
.replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}};
.replace({{=<< >>=}}'{<<baseName>>}'<<={{ }}=>>, encodeURIComponent(String({{paramName}}))){{/pathParams}};

// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.{{httpMethod}});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,31 +397,31 @@ public function testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathE
// path params
if ($path_string !== null) {
$resourcePath = str_replace(
'{' . 'path_string' . '}',
'{path_string}',
ObjectSerializer::toPathValue($path_string),
$resourcePath
);
}
// path params
if ($path_integer !== null) {
$resourcePath = str_replace(
'{' . 'path_integer' . '}',
'{path_integer}',
ObjectSerializer::toPathValue($path_integer),
$resourcePath
);
}
// path params
if ($enum_nonref_string_path !== null) {
$resourcePath = str_replace(
'{' . 'enum_nonref_string_path' . '}',
'{enum_nonref_string_path}',
ObjectSerializer::toPathValue($enum_nonref_string_path),
$resourcePath
);
}
// path params
if ($enum_ref_string_path !== null) {
$resourcePath = str_replace(
'{' . 'enum_ref_string_path' . '}',
'{enum_ref_string_path}',
ObjectSerializer::toPathValue($enum_ref_string_path->value),
$resourcePath
);
Expand Down
8 changes: 4 additions & 4 deletions samples/client/echo_api/php-nextgen/src/Api/PathApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,31 +397,31 @@ public function testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathE
// path params
if ($path_string !== null) {
$resourcePath = str_replace(
'{' . 'path_string' . '}',
'{path_string}',
ObjectSerializer::toPathValue($path_string),
$resourcePath
);
}
// path params
if ($path_integer !== null) {
$resourcePath = str_replace(
'{' . 'path_integer' . '}',
'{path_integer}',
ObjectSerializer::toPathValue($path_integer),
$resourcePath
);
}
// path params
if ($enum_nonref_string_path !== null) {
$resourcePath = str_replace(
'{' . 'enum_nonref_string_path' . '}',
'{enum_nonref_string_path}',
ObjectSerializer::toPathValue($enum_nonref_string_path),
$resourcePath
);
}
// path params
if ($enum_ref_string_path !== null) {
$resourcePath = str_replace(
'{' . 'enum_ref_string_path' . '}',
'{enum_ref_string_path}',
ObjectSerializer::toPathValue($enum_ref_string_path->value),
$resourcePath
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_e
fail ArgumentError, "Missing the required parameter 'enum_ref_string_path' when calling PathApi.tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path"
end
# resource path
local_var_path = '/path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}'.sub('{' + 'path_string' + '}', CGI.escape(path_string.to_s)).sub('{' + 'path_integer' + '}', CGI.escape(path_integer.to_s)).sub('{' + 'enum_nonref_string_path' + '}', CGI.escape(enum_nonref_string_path.to_s)).sub('{' + 'enum_ref_string_path' + '}', CGI.escape(enum_ref_string_path.to_s))
local_var_path = '/path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}'.sub('{path_string}', CGI.escape(path_string.to_s)).sub('{path_integer}', CGI.escape(path_integer.to_s)).sub('{enum_nonref_string_path}', CGI.escape(enum_nonref_string_path.to_s)).sub('{enum_ref_string_path}', CGI.escape(enum_ref_string_path.to_s))

# query parameters
query_params = opts[:query_params] || {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_e
fail ArgumentError, "Missing the required parameter 'enum_ref_string_path' when calling PathApi.tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path"
end
# resource path
local_var_path = '/path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}'.sub('{' + 'path_string' + '}', CGI.escape(path_string.to_s)).sub('{' + 'path_integer' + '}', CGI.escape(path_integer.to_s)).sub('{' + 'enum_nonref_string_path' + '}', CGI.escape(enum_nonref_string_path.to_s)).sub('{' + 'enum_ref_string_path' + '}', CGI.escape(enum_ref_string_path.to_s))
local_var_path = '/path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}'.sub('{path_string}', CGI.escape(path_string.to_s)).sub('{path_integer}', CGI.escape(path_integer.to_s)).sub('{enum_nonref_string_path}', CGI.escape(enum_nonref_string_path.to_s)).sub('{enum_ref_string_path}', CGI.escape(enum_ref_string_path.to_s))

# query parameters
query_params = opts[:query_params] || {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_e
fail ArgumentError, "Missing the required parameter 'enum_ref_string_path' when calling PathApi.tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path"
end
# resource path
local_var_path = '/path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}'.sub('{' + 'path_string' + '}', CGI.escape(path_string.to_s)).sub('{' + 'path_integer' + '}', CGI.escape(path_integer.to_s)).sub('{' + 'enum_nonref_string_path' + '}', CGI.escape(enum_nonref_string_path.to_s)).sub('{' + 'enum_ref_string_path' + '}', CGI.escape(enum_ref_string_path.to_s))
local_var_path = '/path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}'.sub('{path_string}', CGI.escape(path_string.to_s)).sub('{path_integer}', CGI.escape(path_integer.to_s)).sub('{enum_nonref_string_path}', CGI.escape(enum_nonref_string_path.to_s)).sub('{enum_ref_string_path}', CGI.escape(enum_ref_string_path.to_s))

# query parameters
query_params = opts[:query_params] || {}
Expand Down
8 changes: 4 additions & 4 deletions samples/client/echo_api/typescript-axios/build/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1484,10 +1484,10 @@ export const PathApiAxiosParamCreator = function (configuration?: Configuration)
// verify required parameter 'enumRefStringPath' is not null or undefined
assertParamExists('testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath', 'enumRefStringPath', enumRefStringPath)
const localVarPath = `/path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}`
.replace(`{${"path_string"}}`, encodeURIComponent(String(pathString)))
.replace(`{${"path_integer"}}`, encodeURIComponent(String(pathInteger)))
.replace(`{${"enum_nonref_string_path"}}`, encodeURIComponent(String(enumNonrefStringPath)))
.replace(`{${"enum_ref_string_path"}}`, encodeURIComponent(String(enumRefStringPath)));
.replace('{path_string}', encodeURIComponent(String(pathString)))
.replace('{path_integer}', encodeURIComponent(String(pathInteger)))
.replace('{enum_nonref_string_path}', encodeURIComponent(String(enumNonrefStringPath)))
.replace('{enum_ref_string_path}', encodeURIComponent(String(enumRefStringPath)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
Expand Down
8 changes: 4 additions & 4 deletions samples/client/echo_api/typescript/build/apis/PathApi.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ public function fakeDeletePetRequest(
// path params
if ($pet_id !== null) {
$resourcePath = str_replace(
'{' . 'pet_id' . '}',
'{pet_id}',
ObjectSerializer::toPathValue($pet_id),
$resourcePath
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ public function deletePetRequest(
// path params
if ($pet_id !== null) {
$resourcePath = str_replace(
'{' . 'petId' . '}',
'{petId}',
ObjectSerializer::toPathValue($pet_id),
$resourcePath
);
Expand Down Expand Up @@ -1593,7 +1593,7 @@ public function getPetByIdRequest(
// path params
if ($pet_id !== null) {
$resourcePath = str_replace(
'{' . 'petId' . '}',
'{petId}',
ObjectSerializer::toPathValue($pet_id),
$resourcePath
);
Expand Down Expand Up @@ -2248,7 +2248,7 @@ public function updatePetWithFormRequest(
// path params
if ($pet_id !== null) {
$resourcePath = str_replace(
'{' . 'petId' . '}',
'{petId}',
ObjectSerializer::toPathValue($pet_id),
$resourcePath
);
Expand Down Expand Up @@ -2564,7 +2564,7 @@ public function uploadFileRequest(
// path params
if ($pet_id !== null) {
$resourcePath = str_replace(
'{' . 'petId' . '}',
'{petId}',
ObjectSerializer::toPathValue($pet_id),
$resourcePath
);
Expand Down Expand Up @@ -2886,7 +2886,7 @@ public function uploadFileWithRequiredFileRequest(
// path params
if ($pet_id !== null) {
$resourcePath = str_replace(
'{' . 'petId' . '}',
'{petId}',
ObjectSerializer::toPathValue($pet_id),
$resourcePath
);
Expand Down
Loading
Loading