From 0f96d101caf31fbbaca366f08b8388b73cafd1ef Mon Sep 17 00:00:00 2001 From: ChrisJamesC Date: Tue, 29 Nov 2016 11:55:56 +0100 Subject: [PATCH] [Typescript/fetch][Issue4284] Handle query parameters containing colons Put query parameters between quotes and access object keys using square brackets to make sure special characters are handled in parameter names. Closes #4284 --- .../resources/TypeScript-Fetch/api.mustache | 18 +- .../typescript-fetch/builds/default/api.ts | 182 +++++++++--------- .../typescript-fetch/builds/es6-target/api.ts | 182 +++++++++--------- .../builds/with-npm-version/api.ts | 182 +++++++++--------- 4 files changed, 282 insertions(+), 282 deletions(-) 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 f1aa9e6c4bd..4e9f7b28186 100644 --- a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache +++ b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache @@ -14,7 +14,7 @@ const BASE_PATH = "{{{basePath}}}".replace(/\/+$/, ''); export interface FetchArgs { url: string; - options: any; + options: any; } export class BaseAPI { @@ -70,7 +70,7 @@ export const {{classname}}FetchParamCreactor = { * {{notes}}{{/notes}}{{#allParams}} * @param {{paramName}} {{description}}{{/allParams}} */ - {{nickname}}({{#hasParams}}params: { {{#allParams}} {{paramName}}{{^required}}?{{/required}}: {{{dataType}}};{{/allParams}} }{{/hasParams}}): FetchArgs { + {{nickname}}({{#hasParams}}params: { {{#allParams}} "{{paramName}}"{{^required}}?{{/required}}: {{{dataType}}};{{/allParams}} }{{/hasParams}}): FetchArgs { {{#allParams}} {{#required}} // verify required parameter "{{paramName}}" is set @@ -80,11 +80,11 @@ export const {{classname}}FetchParamCreactor = { {{/required}} {{/allParams}} const baseUrl = `{{path}}`{{#pathParams}} - .replace(`{${"{{baseName}}"}}`, `${ params.{{paramName}} }`){{/pathParams}}; + .replace(`{${"{{baseName}}"}}`, `${ params["{{paramName}}"] }`){{/pathParams}}; let urlObj = url.parse(baseUrl, true); {{#hasQueryParams}} urlObj.query = {{#supportsES6}}Object.{{/supportsES6}}assign({}, urlObj.query, { {{#queryParams}} - "{{baseName}}": params.{{paramName}},{{/queryParams}} + "{{baseName}}": params["{{paramName}}"],{{/queryParams}} }); {{/hasQueryParams}} let fetchOptions: RequestInit = { method: "{{httpMethod}}" }; @@ -93,7 +93,7 @@ export const {{classname}}FetchParamCreactor = { {{#hasFormParams}} contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ {{#formParams}} - "{{baseName}}": params.{{paramName}},{{/formParams}} + "{{baseName}}": params["{{paramName}}"],{{/formParams}} }); {{/hasFormParams}} {{#hasBodyParam}} @@ -104,7 +104,7 @@ export const {{classname}}FetchParamCreactor = { {{/hasBodyParam}} {{#hasHeaderParams}} fetchOptions.headers = {{#supportsES6}}Object.{{/supportsES6}}assign({ {{#headerParams}} - "{{baseName}}": params.{{paramName}},{{/headerParams}} + "{{baseName}}": params["{{paramName}}"],{{/headerParams}} }, contentTypeHeader); {{/hasHeaderParams}} {{^hasHeaderParams}} @@ -131,7 +131,7 @@ export const {{classname}}Fp = { * {{notes}}{{/notes}}{{#allParams}} * @param {{paramName}} {{description}}{{/allParams}} */ - {{nickname}}({{#hasParams}}params: { {{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}; {{/allParams}} }{{/hasParams}}): (fetch: FetchAPI, basePath?: string) => Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}any{{/returnType}}> { + {{nickname}}({{#hasParams}}params: { {{#allParams}}"{{paramName}}"{{^required}}?{{/required}}: {{{dataType}}}; {{/allParams}} }{{/hasParams}}): (fetch: FetchAPI, basePath?: string) => Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}any{{/returnType}}> { const fetchArgs = {{classname}}FetchParamCreactor.{{nickname}}({{#hasParams}}params{{/hasParams}}); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -157,7 +157,7 @@ export class {{classname}} extends BaseAPI { * {{notes}}{{/notes}}{{#allParams}} * @param {{paramName}} {{description}}{{/allParams}} */ - {{nickname}}({{#hasParams}}params: { {{#allParams}} {{paramName}}{{^required}}?{{/required}}: {{{dataType}}};{{/allParams}} }{{/hasParams}}) { + {{nickname}}({{#hasParams}}params: { {{#allParams}} "{{paramName}}"{{^required}}?{{/required}}: {{{dataType}}};{{/allParams}} }{{/hasParams}}) { return {{classname}}Fp.{{nickname}}({{#hasParams}}params{{/hasParams}})(this.fetch, this.basePath); } {{/operation}} @@ -175,7 +175,7 @@ export const {{classname}}Factory = function (fetch?: FetchAPI, basePath?: strin * {{notes}}{{/notes}}{{#allParams}} * @param {{paramName}} {{description}}{{/allParams}} */ - {{nickname}}({{#hasParams}}params: { {{#allParams}} {{paramName}}{{^required}}?{{/required}}: {{{dataType}}};{{/allParams}} }{{/hasParams}}) { + {{nickname}}({{#hasParams}}params: { {{#allParams}} "{{paramName}}"{{^required}}?{{/required}}: {{{dataType}}};{{/allParams}} }{{/hasParams}}) { return {{classname}}Fp.{{nickname}}({{#hasParams}}params{{/hasParams}})(fetch, basePath); }, {{/operation}} diff --git a/samples/client/petstore/typescript-fetch/builds/default/api.ts b/samples/client/petstore/typescript-fetch/builds/default/api.ts index 0a699f9f75a..7dac24fbbb1 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/api.ts @@ -23,7 +23,7 @@ const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ''); export interface FetchArgs { url: string; - options: any; + options: any; } export class BaseAPI { @@ -97,7 +97,7 @@ export const PetApiFetchParamCreactor = { * * @param body Pet object that needs to be added to the store */ - addPet(params: { body?: Pet; }): FetchArgs { + addPet(params: { "body"?: Pet; }): FetchArgs { const baseUrl = `/pet`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; @@ -121,19 +121,19 @@ export const PetApiFetchParamCreactor = { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { petId: number; apiKey?: string; }): FetchArgs { + deletePet(params: { "petId": number; "apiKey"?: string; }): FetchArgs { // verify required parameter "petId" is set if (params["petId"] == null) { throw new Error("Missing required parameter petId when calling deletePet"); } const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params.petId }`); + .replace(`{${"petId"}}`, `${ params["petId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "DELETE" }; let contentTypeHeader: Dictionary; fetchOptions.headers = assign({ - "api_key": params.apiKey, + "api_key": params["apiKey"], }, contentTypeHeader); return { url: url.format(urlObj), @@ -145,11 +145,11 @@ export const PetApiFetchParamCreactor = { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { status?: Array; }): FetchArgs { + findPetsByStatus(params: { "status"?: Array; }): FetchArgs { const baseUrl = `/pet/findByStatus`; let urlObj = url.parse(baseUrl, true); urlObj.query = assign({}, urlObj.query, { - "status": params.status, + "status": params["status"], }); let fetchOptions: RequestInit = { method: "GET" }; @@ -167,11 +167,11 @@ export const PetApiFetchParamCreactor = { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { tags?: Array; }): FetchArgs { + findPetsByTags(params: { "tags"?: Array; }): FetchArgs { const baseUrl = `/pet/findByTags`; let urlObj = url.parse(baseUrl, true); urlObj.query = assign({}, urlObj.query, { - "tags": params.tags, + "tags": params["tags"], }); let fetchOptions: RequestInit = { method: "GET" }; @@ -189,13 +189,13 @@ export const PetApiFetchParamCreactor = { * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions * @param petId ID of pet that needs to be fetched */ - getPetById(params: { petId: number; }): FetchArgs { + getPetById(params: { "petId": number; }): FetchArgs { // verify required parameter "petId" is set if (params["petId"] == null) { throw new Error("Missing required parameter petId when calling getPetById"); } const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params.petId }`); + .replace(`{${"petId"}}`, `${ params["petId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "GET" }; @@ -213,7 +213,7 @@ export const PetApiFetchParamCreactor = { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { body?: Pet; }): FetchArgs { + updatePet(params: { "body"?: Pet; }): FetchArgs { const baseUrl = `/pet`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "PUT" }; @@ -238,21 +238,21 @@ export const PetApiFetchParamCreactor = { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { petId: string; name?: string; status?: string; }): FetchArgs { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }): FetchArgs { // verify required parameter "petId" is set if (params["petId"] == null) { throw new Error("Missing required parameter petId when calling updatePetWithForm"); } const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params.petId }`); + .replace(`{${"petId"}}`, `${ params["petId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; let contentTypeHeader: Dictionary; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ - "name": params.name, - "status": params.status, + "name": params["name"], + "status": params["status"], }); if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; @@ -269,21 +269,21 @@ export const PetApiFetchParamCreactor = { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { petId: number; additionalMetadata?: string; file?: any; }): FetchArgs { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }): FetchArgs { // verify required parameter "petId" is set if (params["petId"] == null) { throw new Error("Missing required parameter petId when calling uploadFile"); } const baseUrl = `/pet/{petId}/uploadImage` - .replace(`{${"petId"}}`, `${ params.petId }`); + .replace(`{${"petId"}}`, `${ params["petId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; let contentTypeHeader: Dictionary; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ - "additionalMetadata": params.additionalMetadata, - "file": params.file, + "additionalMetadata": params["additionalMetadata"], + "file": params["file"], }); if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; @@ -304,7 +304,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - addPet(params: { body?: Pet; }): (fetch: FetchAPI, basePath?: string) => Promise { + addPet(params: { "body"?: Pet; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.addPet(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -322,7 +322,7 @@ export const PetApiFp = { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { petId: number; apiKey?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + deletePet(params: { "petId": number; "apiKey"?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.deletePet(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -339,7 +339,7 @@ export const PetApiFp = { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { status?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByStatus(params: { "status"?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreactor.findPetsByStatus(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -356,7 +356,7 @@ export const PetApiFp = { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { tags?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByTags(params: { "tags"?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreactor.findPetsByTags(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -373,7 +373,7 @@ export const PetApiFp = { * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions * @param petId ID of pet that needs to be fetched */ - getPetById(params: { petId: number; }): (fetch: FetchAPI, basePath?: string) => Promise { + getPetById(params: { "petId": number; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.getPetById(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -390,7 +390,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { body?: Pet; }): (fetch: FetchAPI, basePath?: string) => Promise { + updatePet(params: { "body"?: Pet; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.updatePet(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -409,7 +409,7 @@ export const PetApiFp = { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { petId: string; name?: string; status?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.updatePetWithForm(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -428,7 +428,7 @@ export const PetApiFp = { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { petId: number; additionalMetadata?: string; file?: any; }): (fetch: FetchAPI, basePath?: string) => Promise { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.uploadFile(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -451,7 +451,7 @@ export class PetApi extends BaseAPI { * * @param body Pet object that needs to be added to the store */ - addPet(params: { body?: Pet; }) { + addPet(params: { "body"?: Pet; }) { return PetApiFp.addPet(params)(this.fetch, this.basePath); } /** @@ -460,7 +460,7 @@ export class PetApi extends BaseAPI { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { petId: number; apiKey?: string; }) { + deletePet(params: { "petId": number; "apiKey"?: string; }) { return PetApiFp.deletePet(params)(this.fetch, this.basePath); } /** @@ -468,7 +468,7 @@ export class PetApi extends BaseAPI { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { status?: Array; }) { + findPetsByStatus(params: { "status"?: Array; }) { return PetApiFp.findPetsByStatus(params)(this.fetch, this.basePath); } /** @@ -476,7 +476,7 @@ export class PetApi extends BaseAPI { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { tags?: Array; }) { + findPetsByTags(params: { "tags"?: Array; }) { return PetApiFp.findPetsByTags(params)(this.fetch, this.basePath); } /** @@ -484,7 +484,7 @@ export class PetApi extends BaseAPI { * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions * @param petId ID of pet that needs to be fetched */ - getPetById(params: { petId: number; }) { + getPetById(params: { "petId": number; }) { return PetApiFp.getPetById(params)(this.fetch, this.basePath); } /** @@ -492,7 +492,7 @@ export class PetApi extends BaseAPI { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { body?: Pet; }) { + updatePet(params: { "body"?: Pet; }) { return PetApiFp.updatePet(params)(this.fetch, this.basePath); } /** @@ -502,7 +502,7 @@ export class PetApi extends BaseAPI { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { petId: string; name?: string; status?: string; }) { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }) { return PetApiFp.updatePetWithForm(params)(this.fetch, this.basePath); } /** @@ -512,7 +512,7 @@ export class PetApi extends BaseAPI { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { petId: number; additionalMetadata?: string; file?: any; }) { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }) { return PetApiFp.uploadFile(params)(this.fetch, this.basePath); } }; @@ -527,7 +527,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param body Pet object that needs to be added to the store */ - addPet(params: { body?: Pet; }) { + addPet(params: { "body"?: Pet; }) { return PetApiFp.addPet(params)(fetch, basePath); }, /** @@ -536,7 +536,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { petId: number; apiKey?: string; }) { + deletePet(params: { "petId": number; "apiKey"?: string; }) { return PetApiFp.deletePet(params)(fetch, basePath); }, /** @@ -544,7 +544,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { status?: Array; }) { + findPetsByStatus(params: { "status"?: Array; }) { return PetApiFp.findPetsByStatus(params)(fetch, basePath); }, /** @@ -552,7 +552,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { tags?: Array; }) { + findPetsByTags(params: { "tags"?: Array; }) { return PetApiFp.findPetsByTags(params)(fetch, basePath); }, /** @@ -560,7 +560,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions * @param petId ID of pet that needs to be fetched */ - getPetById(params: { petId: number; }) { + getPetById(params: { "petId": number; }) { return PetApiFp.getPetById(params)(fetch, basePath); }, /** @@ -568,7 +568,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { body?: Pet; }) { + updatePet(params: { "body"?: Pet; }) { return PetApiFp.updatePet(params)(fetch, basePath); }, /** @@ -578,7 +578,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { petId: string; name?: string; status?: string; }) { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }) { return PetApiFp.updatePetWithForm(params)(fetch, basePath); }, /** @@ -588,7 +588,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { petId: number; additionalMetadata?: string; file?: any; }) { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }) { return PetApiFp.uploadFile(params)(fetch, basePath); }, } @@ -604,13 +604,13 @@ export const StoreApiFetchParamCreactor = { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - deleteOrder(params: { orderId: string; }): FetchArgs { + deleteOrder(params: { "orderId": string; }): FetchArgs { // verify required parameter "orderId" is set if (params["orderId"] == null) { throw new Error("Missing required parameter orderId when calling deleteOrder"); } const baseUrl = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, `${ params.orderId }`); + .replace(`{${"orderId"}}`, `${ params["orderId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "DELETE" }; @@ -646,13 +646,13 @@ export const StoreApiFetchParamCreactor = { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - getOrderById(params: { orderId: string; }): FetchArgs { + getOrderById(params: { "orderId": string; }): FetchArgs { // verify required parameter "orderId" is set if (params["orderId"] == null) { throw new Error("Missing required parameter orderId when calling getOrderById"); } const baseUrl = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, `${ params.orderId }`); + .replace(`{${"orderId"}}`, `${ params["orderId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "GET" }; @@ -670,7 +670,7 @@ export const StoreApiFetchParamCreactor = { * * @param body order placed for purchasing the pet */ - placeOrder(params: { body?: Order; }): FetchArgs { + placeOrder(params: { "body"?: Order; }): FetchArgs { const baseUrl = `/store/order`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; @@ -699,7 +699,7 @@ export const StoreApiFp = { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - deleteOrder(params: { orderId: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + deleteOrder(params: { "orderId": string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreactor.deleteOrder(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -732,7 +732,7 @@ export const StoreApiFp = { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - getOrderById(params: { orderId: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + getOrderById(params: { "orderId": string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreactor.getOrderById(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -749,7 +749,7 @@ export const StoreApiFp = { * * @param body order placed for purchasing the pet */ - placeOrder(params: { body?: Order; }): (fetch: FetchAPI, basePath?: string) => Promise { + placeOrder(params: { "body"?: Order; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreactor.placeOrder(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -772,7 +772,7 @@ export class StoreApi extends BaseAPI { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - deleteOrder(params: { orderId: string; }) { + deleteOrder(params: { "orderId": string; }) { return StoreApiFp.deleteOrder(params)(this.fetch, this.basePath); } /** @@ -787,7 +787,7 @@ export class StoreApi extends BaseAPI { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - getOrderById(params: { orderId: string; }) { + getOrderById(params: { "orderId": string; }) { return StoreApiFp.getOrderById(params)(this.fetch, this.basePath); } /** @@ -795,7 +795,7 @@ export class StoreApi extends BaseAPI { * * @param body order placed for purchasing the pet */ - placeOrder(params: { body?: Order; }) { + placeOrder(params: { "body"?: Order; }) { return StoreApiFp.placeOrder(params)(this.fetch, this.basePath); } }; @@ -810,7 +810,7 @@ export const StoreApiFactory = function (fetch?: FetchAPI, basePath?: string) { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - deleteOrder(params: { orderId: string; }) { + deleteOrder(params: { "orderId": string; }) { return StoreApiFp.deleteOrder(params)(fetch, basePath); }, /** @@ -825,7 +825,7 @@ export const StoreApiFactory = function (fetch?: FetchAPI, basePath?: string) { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - getOrderById(params: { orderId: string; }) { + getOrderById(params: { "orderId": string; }) { return StoreApiFp.getOrderById(params)(fetch, basePath); }, /** @@ -833,7 +833,7 @@ export const StoreApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param body order placed for purchasing the pet */ - placeOrder(params: { body?: Order; }) { + placeOrder(params: { "body"?: Order; }) { return StoreApiFp.placeOrder(params)(fetch, basePath); }, } @@ -849,7 +849,7 @@ export const UserApiFetchParamCreactor = { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { body?: User; }): FetchArgs { + createUser(params: { "body"?: User; }): FetchArgs { const baseUrl = `/user`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; @@ -872,7 +872,7 @@ export const UserApiFetchParamCreactor = { * * @param body List of user object */ - createUsersWithArrayInput(params: { body?: Array; }): FetchArgs { + createUsersWithArrayInput(params: { "body"?: Array; }): FetchArgs { const baseUrl = `/user/createWithArray`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; @@ -895,7 +895,7 @@ export const UserApiFetchParamCreactor = { * * @param body List of user object */ - createUsersWithListInput(params: { body?: Array; }): FetchArgs { + createUsersWithListInput(params: { "body"?: Array; }): FetchArgs { const baseUrl = `/user/createWithList`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; @@ -918,13 +918,13 @@ export const UserApiFetchParamCreactor = { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { username: string; }): FetchArgs { + deleteUser(params: { "username": string; }): FetchArgs { // verify required parameter "username" is set if (params["username"] == null) { throw new Error("Missing required parameter username when calling deleteUser"); } const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params.username }`); + .replace(`{${"username"}}`, `${ params["username"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "DELETE" }; @@ -942,13 +942,13 @@ export const UserApiFetchParamCreactor = { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { username: string; }): FetchArgs { + getUserByName(params: { "username": string; }): FetchArgs { // verify required parameter "username" is set if (params["username"] == null) { throw new Error("Missing required parameter username when calling getUserByName"); } const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params.username }`); + .replace(`{${"username"}}`, `${ params["username"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "GET" }; @@ -967,12 +967,12 @@ export const UserApiFetchParamCreactor = { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { username?: string; password?: string; }): FetchArgs { + loginUser(params: { "username"?: string; "password"?: string; }): FetchArgs { const baseUrl = `/user/login`; let urlObj = url.parse(baseUrl, true); urlObj.query = assign({}, urlObj.query, { - "username": params.username, - "password": params.password, + "username": params["username"], + "password": params["password"], }); let fetchOptions: RequestInit = { method: "GET" }; @@ -1009,13 +1009,13 @@ export const UserApiFetchParamCreactor = { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { username: string; body?: User; }): FetchArgs { + updateUser(params: { "username": string; "body"?: User; }): FetchArgs { // verify required parameter "username" is set if (params["username"] == null) { throw new Error("Missing required parameter username when calling updateUser"); } const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params.username }`); + .replace(`{${"username"}}`, `${ params["username"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "PUT" }; @@ -1043,7 +1043,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { body?: User; }): (fetch: FetchAPI, basePath?: string) => Promise { + createUser(params: { "body"?: User; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.createUser(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1060,7 +1060,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithArrayInput(params: { body?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithArrayInput(params: { "body"?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.createUsersWithArrayInput(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1077,7 +1077,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithListInput(params: { body?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithListInput(params: { "body"?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.createUsersWithListInput(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1094,7 +1094,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { username: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + deleteUser(params: { "username": string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.deleteUser(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1111,7 +1111,7 @@ export const UserApiFp = { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { username: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + getUserByName(params: { "username": string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.getUserByName(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1129,7 +1129,7 @@ export const UserApiFp = { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { username?: string; password?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + loginUser(params: { "username"?: string; "password"?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.loginUser(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1163,7 +1163,7 @@ export const UserApiFp = { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { username: string; body?: User; }): (fetch: FetchAPI, basePath?: string) => Promise { + updateUser(params: { "username": string; "body"?: User; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.updateUser(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1186,7 +1186,7 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { body?: User; }) { + createUser(params: { "body"?: User; }) { return UserApiFp.createUser(params)(this.fetch, this.basePath); } /** @@ -1194,7 +1194,7 @@ export class UserApi extends BaseAPI { * * @param body List of user object */ - createUsersWithArrayInput(params: { body?: Array; }) { + createUsersWithArrayInput(params: { "body"?: Array; }) { return UserApiFp.createUsersWithArrayInput(params)(this.fetch, this.basePath); } /** @@ -1202,7 +1202,7 @@ export class UserApi extends BaseAPI { * * @param body List of user object */ - createUsersWithListInput(params: { body?: Array; }) { + createUsersWithListInput(params: { "body"?: Array; }) { return UserApiFp.createUsersWithListInput(params)(this.fetch, this.basePath); } /** @@ -1210,7 +1210,7 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { username: string; }) { + deleteUser(params: { "username": string; }) { return UserApiFp.deleteUser(params)(this.fetch, this.basePath); } /** @@ -1218,7 +1218,7 @@ export class UserApi extends BaseAPI { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { username: string; }) { + getUserByName(params: { "username": string; }) { return UserApiFp.getUserByName(params)(this.fetch, this.basePath); } /** @@ -1227,7 +1227,7 @@ export class UserApi extends BaseAPI { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { username?: string; password?: string; }) { + loginUser(params: { "username"?: string; "password"?: string; }) { return UserApiFp.loginUser(params)(this.fetch, this.basePath); } /** @@ -1243,7 +1243,7 @@ export class UserApi extends BaseAPI { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { username: string; body?: User; }) { + updateUser(params: { "username": string; "body"?: User; }) { return UserApiFp.updateUser(params)(this.fetch, this.basePath); } }; @@ -1258,7 +1258,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { body?: User; }) { + createUser(params: { "body"?: User; }) { return UserApiFp.createUser(params)(fetch, basePath); }, /** @@ -1266,7 +1266,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param body List of user object */ - createUsersWithArrayInput(params: { body?: Array; }) { + createUsersWithArrayInput(params: { "body"?: Array; }) { return UserApiFp.createUsersWithArrayInput(params)(fetch, basePath); }, /** @@ -1274,7 +1274,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param body List of user object */ - createUsersWithListInput(params: { body?: Array; }) { + createUsersWithListInput(params: { "body"?: Array; }) { return UserApiFp.createUsersWithListInput(params)(fetch, basePath); }, /** @@ -1282,7 +1282,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { username: string; }) { + deleteUser(params: { "username": string; }) { return UserApiFp.deleteUser(params)(fetch, basePath); }, /** @@ -1290,7 +1290,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { username: string; }) { + getUserByName(params: { "username": string; }) { return UserApiFp.getUserByName(params)(fetch, basePath); }, /** @@ -1299,7 +1299,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { username?: string; password?: string; }) { + loginUser(params: { "username"?: string; "password"?: string; }) { return UserApiFp.loginUser(params)(fetch, basePath); }, /** @@ -1315,7 +1315,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { username: string; body?: User; }) { + updateUser(params: { "username": string; "body"?: User; }) { return UserApiFp.updateUser(params)(fetch, basePath); }, } diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts index 786141130ce..a64f579aa8e 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts @@ -22,7 +22,7 @@ const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ''); export interface FetchArgs { url: string; - options: any; + options: any; } export class BaseAPI { @@ -96,7 +96,7 @@ export const PetApiFetchParamCreactor = { * * @param body Pet object that needs to be added to the store */ - addPet(params: { body?: Pet; }): FetchArgs { + addPet(params: { "body"?: Pet; }): FetchArgs { const baseUrl = `/pet`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; @@ -120,19 +120,19 @@ export const PetApiFetchParamCreactor = { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { petId: number; apiKey?: string; }): FetchArgs { + deletePet(params: { "petId": number; "apiKey"?: string; }): FetchArgs { // verify required parameter "petId" is set if (params["petId"] == null) { throw new Error("Missing required parameter petId when calling deletePet"); } const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params.petId }`); + .replace(`{${"petId"}}`, `${ params["petId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "DELETE" }; let contentTypeHeader: Dictionary; fetchOptions.headers = Object.assign({ - "api_key": params.apiKey, + "api_key": params["apiKey"], }, contentTypeHeader); return { url: url.format(urlObj), @@ -144,11 +144,11 @@ export const PetApiFetchParamCreactor = { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { status?: Array; }): FetchArgs { + findPetsByStatus(params: { "status"?: Array; }): FetchArgs { const baseUrl = `/pet/findByStatus`; let urlObj = url.parse(baseUrl, true); urlObj.query = Object.assign({}, urlObj.query, { - "status": params.status, + "status": params["status"], }); let fetchOptions: RequestInit = { method: "GET" }; @@ -166,11 +166,11 @@ export const PetApiFetchParamCreactor = { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { tags?: Array; }): FetchArgs { + findPetsByTags(params: { "tags"?: Array; }): FetchArgs { const baseUrl = `/pet/findByTags`; let urlObj = url.parse(baseUrl, true); urlObj.query = Object.assign({}, urlObj.query, { - "tags": params.tags, + "tags": params["tags"], }); let fetchOptions: RequestInit = { method: "GET" }; @@ -188,13 +188,13 @@ export const PetApiFetchParamCreactor = { * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions * @param petId ID of pet that needs to be fetched */ - getPetById(params: { petId: number; }): FetchArgs { + getPetById(params: { "petId": number; }): FetchArgs { // verify required parameter "petId" is set if (params["petId"] == null) { throw new Error("Missing required parameter petId when calling getPetById"); } const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params.petId }`); + .replace(`{${"petId"}}`, `${ params["petId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "GET" }; @@ -212,7 +212,7 @@ export const PetApiFetchParamCreactor = { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { body?: Pet; }): FetchArgs { + updatePet(params: { "body"?: Pet; }): FetchArgs { const baseUrl = `/pet`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "PUT" }; @@ -237,21 +237,21 @@ export const PetApiFetchParamCreactor = { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { petId: string; name?: string; status?: string; }): FetchArgs { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }): FetchArgs { // verify required parameter "petId" is set if (params["petId"] == null) { throw new Error("Missing required parameter petId when calling updatePetWithForm"); } const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params.petId }`); + .replace(`{${"petId"}}`, `${ params["petId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; let contentTypeHeader: Dictionary; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ - "name": params.name, - "status": params.status, + "name": params["name"], + "status": params["status"], }); if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; @@ -268,21 +268,21 @@ export const PetApiFetchParamCreactor = { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { petId: number; additionalMetadata?: string; file?: any; }): FetchArgs { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }): FetchArgs { // verify required parameter "petId" is set if (params["petId"] == null) { throw new Error("Missing required parameter petId when calling uploadFile"); } const baseUrl = `/pet/{petId}/uploadImage` - .replace(`{${"petId"}}`, `${ params.petId }`); + .replace(`{${"petId"}}`, `${ params["petId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; let contentTypeHeader: Dictionary; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ - "additionalMetadata": params.additionalMetadata, - "file": params.file, + "additionalMetadata": params["additionalMetadata"], + "file": params["file"], }); if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; @@ -303,7 +303,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - addPet(params: { body?: Pet; }): (fetch: FetchAPI, basePath?: string) => Promise { + addPet(params: { "body"?: Pet; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.addPet(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -321,7 +321,7 @@ export const PetApiFp = { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { petId: number; apiKey?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + deletePet(params: { "petId": number; "apiKey"?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.deletePet(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -338,7 +338,7 @@ export const PetApiFp = { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { status?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByStatus(params: { "status"?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreactor.findPetsByStatus(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -355,7 +355,7 @@ export const PetApiFp = { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { tags?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByTags(params: { "tags"?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreactor.findPetsByTags(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -372,7 +372,7 @@ export const PetApiFp = { * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions * @param petId ID of pet that needs to be fetched */ - getPetById(params: { petId: number; }): (fetch: FetchAPI, basePath?: string) => Promise { + getPetById(params: { "petId": number; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.getPetById(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -389,7 +389,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { body?: Pet; }): (fetch: FetchAPI, basePath?: string) => Promise { + updatePet(params: { "body"?: Pet; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.updatePet(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -408,7 +408,7 @@ export const PetApiFp = { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { petId: string; name?: string; status?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.updatePetWithForm(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -427,7 +427,7 @@ export const PetApiFp = { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { petId: number; additionalMetadata?: string; file?: any; }): (fetch: FetchAPI, basePath?: string) => Promise { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.uploadFile(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -450,7 +450,7 @@ export class PetApi extends BaseAPI { * * @param body Pet object that needs to be added to the store */ - addPet(params: { body?: Pet; }) { + addPet(params: { "body"?: Pet; }) { return PetApiFp.addPet(params)(this.fetch, this.basePath); } /** @@ -459,7 +459,7 @@ export class PetApi extends BaseAPI { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { petId: number; apiKey?: string; }) { + deletePet(params: { "petId": number; "apiKey"?: string; }) { return PetApiFp.deletePet(params)(this.fetch, this.basePath); } /** @@ -467,7 +467,7 @@ export class PetApi extends BaseAPI { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { status?: Array; }) { + findPetsByStatus(params: { "status"?: Array; }) { return PetApiFp.findPetsByStatus(params)(this.fetch, this.basePath); } /** @@ -475,7 +475,7 @@ export class PetApi extends BaseAPI { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { tags?: Array; }) { + findPetsByTags(params: { "tags"?: Array; }) { return PetApiFp.findPetsByTags(params)(this.fetch, this.basePath); } /** @@ -483,7 +483,7 @@ export class PetApi extends BaseAPI { * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions * @param petId ID of pet that needs to be fetched */ - getPetById(params: { petId: number; }) { + getPetById(params: { "petId": number; }) { return PetApiFp.getPetById(params)(this.fetch, this.basePath); } /** @@ -491,7 +491,7 @@ export class PetApi extends BaseAPI { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { body?: Pet; }) { + updatePet(params: { "body"?: Pet; }) { return PetApiFp.updatePet(params)(this.fetch, this.basePath); } /** @@ -501,7 +501,7 @@ export class PetApi extends BaseAPI { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { petId: string; name?: string; status?: string; }) { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }) { return PetApiFp.updatePetWithForm(params)(this.fetch, this.basePath); } /** @@ -511,7 +511,7 @@ export class PetApi extends BaseAPI { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { petId: number; additionalMetadata?: string; file?: any; }) { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }) { return PetApiFp.uploadFile(params)(this.fetch, this.basePath); } }; @@ -526,7 +526,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param body Pet object that needs to be added to the store */ - addPet(params: { body?: Pet; }) { + addPet(params: { "body"?: Pet; }) { return PetApiFp.addPet(params)(fetch, basePath); }, /** @@ -535,7 +535,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { petId: number; apiKey?: string; }) { + deletePet(params: { "petId": number; "apiKey"?: string; }) { return PetApiFp.deletePet(params)(fetch, basePath); }, /** @@ -543,7 +543,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { status?: Array; }) { + findPetsByStatus(params: { "status"?: Array; }) { return PetApiFp.findPetsByStatus(params)(fetch, basePath); }, /** @@ -551,7 +551,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { tags?: Array; }) { + findPetsByTags(params: { "tags"?: Array; }) { return PetApiFp.findPetsByTags(params)(fetch, basePath); }, /** @@ -559,7 +559,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions * @param petId ID of pet that needs to be fetched */ - getPetById(params: { petId: number; }) { + getPetById(params: { "petId": number; }) { return PetApiFp.getPetById(params)(fetch, basePath); }, /** @@ -567,7 +567,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { body?: Pet; }) { + updatePet(params: { "body"?: Pet; }) { return PetApiFp.updatePet(params)(fetch, basePath); }, /** @@ -577,7 +577,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { petId: string; name?: string; status?: string; }) { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }) { return PetApiFp.updatePetWithForm(params)(fetch, basePath); }, /** @@ -587,7 +587,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { petId: number; additionalMetadata?: string; file?: any; }) { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }) { return PetApiFp.uploadFile(params)(fetch, basePath); }, } @@ -603,13 +603,13 @@ export const StoreApiFetchParamCreactor = { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - deleteOrder(params: { orderId: string; }): FetchArgs { + deleteOrder(params: { "orderId": string; }): FetchArgs { // verify required parameter "orderId" is set if (params["orderId"] == null) { throw new Error("Missing required parameter orderId when calling deleteOrder"); } const baseUrl = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, `${ params.orderId }`); + .replace(`{${"orderId"}}`, `${ params["orderId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "DELETE" }; @@ -645,13 +645,13 @@ export const StoreApiFetchParamCreactor = { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - getOrderById(params: { orderId: string; }): FetchArgs { + getOrderById(params: { "orderId": string; }): FetchArgs { // verify required parameter "orderId" is set if (params["orderId"] == null) { throw new Error("Missing required parameter orderId when calling getOrderById"); } const baseUrl = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, `${ params.orderId }`); + .replace(`{${"orderId"}}`, `${ params["orderId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "GET" }; @@ -669,7 +669,7 @@ export const StoreApiFetchParamCreactor = { * * @param body order placed for purchasing the pet */ - placeOrder(params: { body?: Order; }): FetchArgs { + placeOrder(params: { "body"?: Order; }): FetchArgs { const baseUrl = `/store/order`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; @@ -698,7 +698,7 @@ export const StoreApiFp = { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - deleteOrder(params: { orderId: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + deleteOrder(params: { "orderId": string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreactor.deleteOrder(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -731,7 +731,7 @@ export const StoreApiFp = { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - getOrderById(params: { orderId: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + getOrderById(params: { "orderId": string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreactor.getOrderById(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -748,7 +748,7 @@ export const StoreApiFp = { * * @param body order placed for purchasing the pet */ - placeOrder(params: { body?: Order; }): (fetch: FetchAPI, basePath?: string) => Promise { + placeOrder(params: { "body"?: Order; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreactor.placeOrder(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -771,7 +771,7 @@ export class StoreApi extends BaseAPI { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - deleteOrder(params: { orderId: string; }) { + deleteOrder(params: { "orderId": string; }) { return StoreApiFp.deleteOrder(params)(this.fetch, this.basePath); } /** @@ -786,7 +786,7 @@ export class StoreApi extends BaseAPI { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - getOrderById(params: { orderId: string; }) { + getOrderById(params: { "orderId": string; }) { return StoreApiFp.getOrderById(params)(this.fetch, this.basePath); } /** @@ -794,7 +794,7 @@ export class StoreApi extends BaseAPI { * * @param body order placed for purchasing the pet */ - placeOrder(params: { body?: Order; }) { + placeOrder(params: { "body"?: Order; }) { return StoreApiFp.placeOrder(params)(this.fetch, this.basePath); } }; @@ -809,7 +809,7 @@ export const StoreApiFactory = function (fetch?: FetchAPI, basePath?: string) { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - deleteOrder(params: { orderId: string; }) { + deleteOrder(params: { "orderId": string; }) { return StoreApiFp.deleteOrder(params)(fetch, basePath); }, /** @@ -824,7 +824,7 @@ export const StoreApiFactory = function (fetch?: FetchAPI, basePath?: string) { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - getOrderById(params: { orderId: string; }) { + getOrderById(params: { "orderId": string; }) { return StoreApiFp.getOrderById(params)(fetch, basePath); }, /** @@ -832,7 +832,7 @@ export const StoreApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param body order placed for purchasing the pet */ - placeOrder(params: { body?: Order; }) { + placeOrder(params: { "body"?: Order; }) { return StoreApiFp.placeOrder(params)(fetch, basePath); }, } @@ -848,7 +848,7 @@ export const UserApiFetchParamCreactor = { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { body?: User; }): FetchArgs { + createUser(params: { "body"?: User; }): FetchArgs { const baseUrl = `/user`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; @@ -871,7 +871,7 @@ export const UserApiFetchParamCreactor = { * * @param body List of user object */ - createUsersWithArrayInput(params: { body?: Array; }): FetchArgs { + createUsersWithArrayInput(params: { "body"?: Array; }): FetchArgs { const baseUrl = `/user/createWithArray`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; @@ -894,7 +894,7 @@ export const UserApiFetchParamCreactor = { * * @param body List of user object */ - createUsersWithListInput(params: { body?: Array; }): FetchArgs { + createUsersWithListInput(params: { "body"?: Array; }): FetchArgs { const baseUrl = `/user/createWithList`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; @@ -917,13 +917,13 @@ export const UserApiFetchParamCreactor = { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { username: string; }): FetchArgs { + deleteUser(params: { "username": string; }): FetchArgs { // verify required parameter "username" is set if (params["username"] == null) { throw new Error("Missing required parameter username when calling deleteUser"); } const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params.username }`); + .replace(`{${"username"}}`, `${ params["username"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "DELETE" }; @@ -941,13 +941,13 @@ export const UserApiFetchParamCreactor = { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { username: string; }): FetchArgs { + getUserByName(params: { "username": string; }): FetchArgs { // verify required parameter "username" is set if (params["username"] == null) { throw new Error("Missing required parameter username when calling getUserByName"); } const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params.username }`); + .replace(`{${"username"}}`, `${ params["username"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "GET" }; @@ -966,12 +966,12 @@ export const UserApiFetchParamCreactor = { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { username?: string; password?: string; }): FetchArgs { + loginUser(params: { "username"?: string; "password"?: string; }): FetchArgs { const baseUrl = `/user/login`; let urlObj = url.parse(baseUrl, true); urlObj.query = Object.assign({}, urlObj.query, { - "username": params.username, - "password": params.password, + "username": params["username"], + "password": params["password"], }); let fetchOptions: RequestInit = { method: "GET" }; @@ -1008,13 +1008,13 @@ export const UserApiFetchParamCreactor = { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { username: string; body?: User; }): FetchArgs { + updateUser(params: { "username": string; "body"?: User; }): FetchArgs { // verify required parameter "username" is set if (params["username"] == null) { throw new Error("Missing required parameter username when calling updateUser"); } const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params.username }`); + .replace(`{${"username"}}`, `${ params["username"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "PUT" }; @@ -1042,7 +1042,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { body?: User; }): (fetch: FetchAPI, basePath?: string) => Promise { + createUser(params: { "body"?: User; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.createUser(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1059,7 +1059,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithArrayInput(params: { body?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithArrayInput(params: { "body"?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.createUsersWithArrayInput(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1076,7 +1076,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithListInput(params: { body?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithListInput(params: { "body"?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.createUsersWithListInput(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1093,7 +1093,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { username: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + deleteUser(params: { "username": string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.deleteUser(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1110,7 +1110,7 @@ export const UserApiFp = { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { username: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + getUserByName(params: { "username": string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.getUserByName(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1128,7 +1128,7 @@ export const UserApiFp = { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { username?: string; password?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + loginUser(params: { "username"?: string; "password"?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.loginUser(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1162,7 +1162,7 @@ export const UserApiFp = { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { username: string; body?: User; }): (fetch: FetchAPI, basePath?: string) => Promise { + updateUser(params: { "username": string; "body"?: User; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.updateUser(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1185,7 +1185,7 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { body?: User; }) { + createUser(params: { "body"?: User; }) { return UserApiFp.createUser(params)(this.fetch, this.basePath); } /** @@ -1193,7 +1193,7 @@ export class UserApi extends BaseAPI { * * @param body List of user object */ - createUsersWithArrayInput(params: { body?: Array; }) { + createUsersWithArrayInput(params: { "body"?: Array; }) { return UserApiFp.createUsersWithArrayInput(params)(this.fetch, this.basePath); } /** @@ -1201,7 +1201,7 @@ export class UserApi extends BaseAPI { * * @param body List of user object */ - createUsersWithListInput(params: { body?: Array; }) { + createUsersWithListInput(params: { "body"?: Array; }) { return UserApiFp.createUsersWithListInput(params)(this.fetch, this.basePath); } /** @@ -1209,7 +1209,7 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { username: string; }) { + deleteUser(params: { "username": string; }) { return UserApiFp.deleteUser(params)(this.fetch, this.basePath); } /** @@ -1217,7 +1217,7 @@ export class UserApi extends BaseAPI { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { username: string; }) { + getUserByName(params: { "username": string; }) { return UserApiFp.getUserByName(params)(this.fetch, this.basePath); } /** @@ -1226,7 +1226,7 @@ export class UserApi extends BaseAPI { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { username?: string; password?: string; }) { + loginUser(params: { "username"?: string; "password"?: string; }) { return UserApiFp.loginUser(params)(this.fetch, this.basePath); } /** @@ -1242,7 +1242,7 @@ export class UserApi extends BaseAPI { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { username: string; body?: User; }) { + updateUser(params: { "username": string; "body"?: User; }) { return UserApiFp.updateUser(params)(this.fetch, this.basePath); } }; @@ -1257,7 +1257,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { body?: User; }) { + createUser(params: { "body"?: User; }) { return UserApiFp.createUser(params)(fetch, basePath); }, /** @@ -1265,7 +1265,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param body List of user object */ - createUsersWithArrayInput(params: { body?: Array; }) { + createUsersWithArrayInput(params: { "body"?: Array; }) { return UserApiFp.createUsersWithArrayInput(params)(fetch, basePath); }, /** @@ -1273,7 +1273,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param body List of user object */ - createUsersWithListInput(params: { body?: Array; }) { + createUsersWithListInput(params: { "body"?: Array; }) { return UserApiFp.createUsersWithListInput(params)(fetch, basePath); }, /** @@ -1281,7 +1281,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { username: string; }) { + deleteUser(params: { "username": string; }) { return UserApiFp.deleteUser(params)(fetch, basePath); }, /** @@ -1289,7 +1289,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { username: string; }) { + getUserByName(params: { "username": string; }) { return UserApiFp.getUserByName(params)(fetch, basePath); }, /** @@ -1298,7 +1298,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { username?: string; password?: string; }) { + loginUser(params: { "username"?: string; "password"?: string; }) { return UserApiFp.loginUser(params)(fetch, basePath); }, /** @@ -1314,7 +1314,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { username: string; body?: User; }) { + updateUser(params: { "username": string; "body"?: User; }) { return UserApiFp.updateUser(params)(fetch, basePath); }, } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts index 0a699f9f75a..7dac24fbbb1 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts @@ -23,7 +23,7 @@ const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ''); export interface FetchArgs { url: string; - options: any; + options: any; } export class BaseAPI { @@ -97,7 +97,7 @@ export const PetApiFetchParamCreactor = { * * @param body Pet object that needs to be added to the store */ - addPet(params: { body?: Pet; }): FetchArgs { + addPet(params: { "body"?: Pet; }): FetchArgs { const baseUrl = `/pet`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; @@ -121,19 +121,19 @@ export const PetApiFetchParamCreactor = { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { petId: number; apiKey?: string; }): FetchArgs { + deletePet(params: { "petId": number; "apiKey"?: string; }): FetchArgs { // verify required parameter "petId" is set if (params["petId"] == null) { throw new Error("Missing required parameter petId when calling deletePet"); } const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params.petId }`); + .replace(`{${"petId"}}`, `${ params["petId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "DELETE" }; let contentTypeHeader: Dictionary; fetchOptions.headers = assign({ - "api_key": params.apiKey, + "api_key": params["apiKey"], }, contentTypeHeader); return { url: url.format(urlObj), @@ -145,11 +145,11 @@ export const PetApiFetchParamCreactor = { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { status?: Array; }): FetchArgs { + findPetsByStatus(params: { "status"?: Array; }): FetchArgs { const baseUrl = `/pet/findByStatus`; let urlObj = url.parse(baseUrl, true); urlObj.query = assign({}, urlObj.query, { - "status": params.status, + "status": params["status"], }); let fetchOptions: RequestInit = { method: "GET" }; @@ -167,11 +167,11 @@ export const PetApiFetchParamCreactor = { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { tags?: Array; }): FetchArgs { + findPetsByTags(params: { "tags"?: Array; }): FetchArgs { const baseUrl = `/pet/findByTags`; let urlObj = url.parse(baseUrl, true); urlObj.query = assign({}, urlObj.query, { - "tags": params.tags, + "tags": params["tags"], }); let fetchOptions: RequestInit = { method: "GET" }; @@ -189,13 +189,13 @@ export const PetApiFetchParamCreactor = { * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions * @param petId ID of pet that needs to be fetched */ - getPetById(params: { petId: number; }): FetchArgs { + getPetById(params: { "petId": number; }): FetchArgs { // verify required parameter "petId" is set if (params["petId"] == null) { throw new Error("Missing required parameter petId when calling getPetById"); } const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params.petId }`); + .replace(`{${"petId"}}`, `${ params["petId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "GET" }; @@ -213,7 +213,7 @@ export const PetApiFetchParamCreactor = { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { body?: Pet; }): FetchArgs { + updatePet(params: { "body"?: Pet; }): FetchArgs { const baseUrl = `/pet`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "PUT" }; @@ -238,21 +238,21 @@ export const PetApiFetchParamCreactor = { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { petId: string; name?: string; status?: string; }): FetchArgs { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }): FetchArgs { // verify required parameter "petId" is set if (params["petId"] == null) { throw new Error("Missing required parameter petId when calling updatePetWithForm"); } const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params.petId }`); + .replace(`{${"petId"}}`, `${ params["petId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; let contentTypeHeader: Dictionary; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ - "name": params.name, - "status": params.status, + "name": params["name"], + "status": params["status"], }); if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; @@ -269,21 +269,21 @@ export const PetApiFetchParamCreactor = { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { petId: number; additionalMetadata?: string; file?: any; }): FetchArgs { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }): FetchArgs { // verify required parameter "petId" is set if (params["petId"] == null) { throw new Error("Missing required parameter petId when calling uploadFile"); } const baseUrl = `/pet/{petId}/uploadImage` - .replace(`{${"petId"}}`, `${ params.petId }`); + .replace(`{${"petId"}}`, `${ params["petId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; let contentTypeHeader: Dictionary; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ - "additionalMetadata": params.additionalMetadata, - "file": params.file, + "additionalMetadata": params["additionalMetadata"], + "file": params["file"], }); if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; @@ -304,7 +304,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - addPet(params: { body?: Pet; }): (fetch: FetchAPI, basePath?: string) => Promise { + addPet(params: { "body"?: Pet; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.addPet(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -322,7 +322,7 @@ export const PetApiFp = { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { petId: number; apiKey?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + deletePet(params: { "petId": number; "apiKey"?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.deletePet(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -339,7 +339,7 @@ export const PetApiFp = { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { status?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByStatus(params: { "status"?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreactor.findPetsByStatus(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -356,7 +356,7 @@ export const PetApiFp = { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { tags?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByTags(params: { "tags"?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreactor.findPetsByTags(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -373,7 +373,7 @@ export const PetApiFp = { * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions * @param petId ID of pet that needs to be fetched */ - getPetById(params: { petId: number; }): (fetch: FetchAPI, basePath?: string) => Promise { + getPetById(params: { "petId": number; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.getPetById(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -390,7 +390,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { body?: Pet; }): (fetch: FetchAPI, basePath?: string) => Promise { + updatePet(params: { "body"?: Pet; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.updatePet(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -409,7 +409,7 @@ export const PetApiFp = { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { petId: string; name?: string; status?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.updatePetWithForm(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -428,7 +428,7 @@ export const PetApiFp = { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { petId: number; additionalMetadata?: string; file?: any; }): (fetch: FetchAPI, basePath?: string) => Promise { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreactor.uploadFile(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -451,7 +451,7 @@ export class PetApi extends BaseAPI { * * @param body Pet object that needs to be added to the store */ - addPet(params: { body?: Pet; }) { + addPet(params: { "body"?: Pet; }) { return PetApiFp.addPet(params)(this.fetch, this.basePath); } /** @@ -460,7 +460,7 @@ export class PetApi extends BaseAPI { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { petId: number; apiKey?: string; }) { + deletePet(params: { "petId": number; "apiKey"?: string; }) { return PetApiFp.deletePet(params)(this.fetch, this.basePath); } /** @@ -468,7 +468,7 @@ export class PetApi extends BaseAPI { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { status?: Array; }) { + findPetsByStatus(params: { "status"?: Array; }) { return PetApiFp.findPetsByStatus(params)(this.fetch, this.basePath); } /** @@ -476,7 +476,7 @@ export class PetApi extends BaseAPI { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { tags?: Array; }) { + findPetsByTags(params: { "tags"?: Array; }) { return PetApiFp.findPetsByTags(params)(this.fetch, this.basePath); } /** @@ -484,7 +484,7 @@ export class PetApi extends BaseAPI { * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions * @param petId ID of pet that needs to be fetched */ - getPetById(params: { petId: number; }) { + getPetById(params: { "petId": number; }) { return PetApiFp.getPetById(params)(this.fetch, this.basePath); } /** @@ -492,7 +492,7 @@ export class PetApi extends BaseAPI { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { body?: Pet; }) { + updatePet(params: { "body"?: Pet; }) { return PetApiFp.updatePet(params)(this.fetch, this.basePath); } /** @@ -502,7 +502,7 @@ export class PetApi extends BaseAPI { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { petId: string; name?: string; status?: string; }) { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }) { return PetApiFp.updatePetWithForm(params)(this.fetch, this.basePath); } /** @@ -512,7 +512,7 @@ export class PetApi extends BaseAPI { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { petId: number; additionalMetadata?: string; file?: any; }) { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }) { return PetApiFp.uploadFile(params)(this.fetch, this.basePath); } }; @@ -527,7 +527,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param body Pet object that needs to be added to the store */ - addPet(params: { body?: Pet; }) { + addPet(params: { "body"?: Pet; }) { return PetApiFp.addPet(params)(fetch, basePath); }, /** @@ -536,7 +536,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { petId: number; apiKey?: string; }) { + deletePet(params: { "petId": number; "apiKey"?: string; }) { return PetApiFp.deletePet(params)(fetch, basePath); }, /** @@ -544,7 +544,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { status?: Array; }) { + findPetsByStatus(params: { "status"?: Array; }) { return PetApiFp.findPetsByStatus(params)(fetch, basePath); }, /** @@ -552,7 +552,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { tags?: Array; }) { + findPetsByTags(params: { "tags"?: Array; }) { return PetApiFp.findPetsByTags(params)(fetch, basePath); }, /** @@ -560,7 +560,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions * @param petId ID of pet that needs to be fetched */ - getPetById(params: { petId: number; }) { + getPetById(params: { "petId": number; }) { return PetApiFp.getPetById(params)(fetch, basePath); }, /** @@ -568,7 +568,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { body?: Pet; }) { + updatePet(params: { "body"?: Pet; }) { return PetApiFp.updatePet(params)(fetch, basePath); }, /** @@ -578,7 +578,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { petId: string; name?: string; status?: string; }) { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }) { return PetApiFp.updatePetWithForm(params)(fetch, basePath); }, /** @@ -588,7 +588,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { petId: number; additionalMetadata?: string; file?: any; }) { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }) { return PetApiFp.uploadFile(params)(fetch, basePath); }, } @@ -604,13 +604,13 @@ export const StoreApiFetchParamCreactor = { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - deleteOrder(params: { orderId: string; }): FetchArgs { + deleteOrder(params: { "orderId": string; }): FetchArgs { // verify required parameter "orderId" is set if (params["orderId"] == null) { throw new Error("Missing required parameter orderId when calling deleteOrder"); } const baseUrl = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, `${ params.orderId }`); + .replace(`{${"orderId"}}`, `${ params["orderId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "DELETE" }; @@ -646,13 +646,13 @@ export const StoreApiFetchParamCreactor = { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - getOrderById(params: { orderId: string; }): FetchArgs { + getOrderById(params: { "orderId": string; }): FetchArgs { // verify required parameter "orderId" is set if (params["orderId"] == null) { throw new Error("Missing required parameter orderId when calling getOrderById"); } const baseUrl = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, `${ params.orderId }`); + .replace(`{${"orderId"}}`, `${ params["orderId"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "GET" }; @@ -670,7 +670,7 @@ export const StoreApiFetchParamCreactor = { * * @param body order placed for purchasing the pet */ - placeOrder(params: { body?: Order; }): FetchArgs { + placeOrder(params: { "body"?: Order; }): FetchArgs { const baseUrl = `/store/order`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; @@ -699,7 +699,7 @@ export const StoreApiFp = { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - deleteOrder(params: { orderId: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + deleteOrder(params: { "orderId": string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreactor.deleteOrder(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -732,7 +732,7 @@ export const StoreApiFp = { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - getOrderById(params: { orderId: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + getOrderById(params: { "orderId": string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreactor.getOrderById(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -749,7 +749,7 @@ export const StoreApiFp = { * * @param body order placed for purchasing the pet */ - placeOrder(params: { body?: Order; }): (fetch: FetchAPI, basePath?: string) => Promise { + placeOrder(params: { "body"?: Order; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreactor.placeOrder(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -772,7 +772,7 @@ export class StoreApi extends BaseAPI { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - deleteOrder(params: { orderId: string; }) { + deleteOrder(params: { "orderId": string; }) { return StoreApiFp.deleteOrder(params)(this.fetch, this.basePath); } /** @@ -787,7 +787,7 @@ export class StoreApi extends BaseAPI { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - getOrderById(params: { orderId: string; }) { + getOrderById(params: { "orderId": string; }) { return StoreApiFp.getOrderById(params)(this.fetch, this.basePath); } /** @@ -795,7 +795,7 @@ export class StoreApi extends BaseAPI { * * @param body order placed for purchasing the pet */ - placeOrder(params: { body?: Order; }) { + placeOrder(params: { "body"?: Order; }) { return StoreApiFp.placeOrder(params)(this.fetch, this.basePath); } }; @@ -810,7 +810,7 @@ export const StoreApiFactory = function (fetch?: FetchAPI, basePath?: string) { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - deleteOrder(params: { orderId: string; }) { + deleteOrder(params: { "orderId": string; }) { return StoreApiFp.deleteOrder(params)(fetch, basePath); }, /** @@ -825,7 +825,7 @@ export const StoreApiFactory = function (fetch?: FetchAPI, basePath?: string) { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - getOrderById(params: { orderId: string; }) { + getOrderById(params: { "orderId": string; }) { return StoreApiFp.getOrderById(params)(fetch, basePath); }, /** @@ -833,7 +833,7 @@ export const StoreApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param body order placed for purchasing the pet */ - placeOrder(params: { body?: Order; }) { + placeOrder(params: { "body"?: Order; }) { return StoreApiFp.placeOrder(params)(fetch, basePath); }, } @@ -849,7 +849,7 @@ export const UserApiFetchParamCreactor = { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { body?: User; }): FetchArgs { + createUser(params: { "body"?: User; }): FetchArgs { const baseUrl = `/user`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; @@ -872,7 +872,7 @@ export const UserApiFetchParamCreactor = { * * @param body List of user object */ - createUsersWithArrayInput(params: { body?: Array; }): FetchArgs { + createUsersWithArrayInput(params: { "body"?: Array; }): FetchArgs { const baseUrl = `/user/createWithArray`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; @@ -895,7 +895,7 @@ export const UserApiFetchParamCreactor = { * * @param body List of user object */ - createUsersWithListInput(params: { body?: Array; }): FetchArgs { + createUsersWithListInput(params: { "body"?: Array; }): FetchArgs { const baseUrl = `/user/createWithList`; let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "POST" }; @@ -918,13 +918,13 @@ export const UserApiFetchParamCreactor = { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { username: string; }): FetchArgs { + deleteUser(params: { "username": string; }): FetchArgs { // verify required parameter "username" is set if (params["username"] == null) { throw new Error("Missing required parameter username when calling deleteUser"); } const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params.username }`); + .replace(`{${"username"}}`, `${ params["username"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "DELETE" }; @@ -942,13 +942,13 @@ export const UserApiFetchParamCreactor = { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { username: string; }): FetchArgs { + getUserByName(params: { "username": string; }): FetchArgs { // verify required parameter "username" is set if (params["username"] == null) { throw new Error("Missing required parameter username when calling getUserByName"); } const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params.username }`); + .replace(`{${"username"}}`, `${ params["username"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "GET" }; @@ -967,12 +967,12 @@ export const UserApiFetchParamCreactor = { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { username?: string; password?: string; }): FetchArgs { + loginUser(params: { "username"?: string; "password"?: string; }): FetchArgs { const baseUrl = `/user/login`; let urlObj = url.parse(baseUrl, true); urlObj.query = assign({}, urlObj.query, { - "username": params.username, - "password": params.password, + "username": params["username"], + "password": params["password"], }); let fetchOptions: RequestInit = { method: "GET" }; @@ -1009,13 +1009,13 @@ export const UserApiFetchParamCreactor = { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { username: string; body?: User; }): FetchArgs { + updateUser(params: { "username": string; "body"?: User; }): FetchArgs { // verify required parameter "username" is set if (params["username"] == null) { throw new Error("Missing required parameter username when calling updateUser"); } const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params.username }`); + .replace(`{${"username"}}`, `${ params["username"] }`); let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = { method: "PUT" }; @@ -1043,7 +1043,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { body?: User; }): (fetch: FetchAPI, basePath?: string) => Promise { + createUser(params: { "body"?: User; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.createUser(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1060,7 +1060,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithArrayInput(params: { body?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithArrayInput(params: { "body"?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.createUsersWithArrayInput(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1077,7 +1077,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithListInput(params: { body?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithListInput(params: { "body"?: Array; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.createUsersWithListInput(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1094,7 +1094,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { username: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + deleteUser(params: { "username": string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.deleteUser(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1111,7 +1111,7 @@ export const UserApiFp = { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { username: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + getUserByName(params: { "username": string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.getUserByName(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1129,7 +1129,7 @@ export const UserApiFp = { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { username?: string; password?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { + loginUser(params: { "username"?: string; "password"?: string; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.loginUser(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1163,7 +1163,7 @@ export const UserApiFp = { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { username: string; body?: User; }): (fetch: FetchAPI, basePath?: string) => Promise { + updateUser(params: { "username": string; "body"?: User; }): (fetch: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreactor.updateUser(params); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1186,7 +1186,7 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { body?: User; }) { + createUser(params: { "body"?: User; }) { return UserApiFp.createUser(params)(this.fetch, this.basePath); } /** @@ -1194,7 +1194,7 @@ export class UserApi extends BaseAPI { * * @param body List of user object */ - createUsersWithArrayInput(params: { body?: Array; }) { + createUsersWithArrayInput(params: { "body"?: Array; }) { return UserApiFp.createUsersWithArrayInput(params)(this.fetch, this.basePath); } /** @@ -1202,7 +1202,7 @@ export class UserApi extends BaseAPI { * * @param body List of user object */ - createUsersWithListInput(params: { body?: Array; }) { + createUsersWithListInput(params: { "body"?: Array; }) { return UserApiFp.createUsersWithListInput(params)(this.fetch, this.basePath); } /** @@ -1210,7 +1210,7 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { username: string; }) { + deleteUser(params: { "username": string; }) { return UserApiFp.deleteUser(params)(this.fetch, this.basePath); } /** @@ -1218,7 +1218,7 @@ export class UserApi extends BaseAPI { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { username: string; }) { + getUserByName(params: { "username": string; }) { return UserApiFp.getUserByName(params)(this.fetch, this.basePath); } /** @@ -1227,7 +1227,7 @@ export class UserApi extends BaseAPI { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { username?: string; password?: string; }) { + loginUser(params: { "username"?: string; "password"?: string; }) { return UserApiFp.loginUser(params)(this.fetch, this.basePath); } /** @@ -1243,7 +1243,7 @@ export class UserApi extends BaseAPI { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { username: string; body?: User; }) { + updateUser(params: { "username": string; "body"?: User; }) { return UserApiFp.updateUser(params)(this.fetch, this.basePath); } }; @@ -1258,7 +1258,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { body?: User; }) { + createUser(params: { "body"?: User; }) { return UserApiFp.createUser(params)(fetch, basePath); }, /** @@ -1266,7 +1266,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param body List of user object */ - createUsersWithArrayInput(params: { body?: Array; }) { + createUsersWithArrayInput(params: { "body"?: Array; }) { return UserApiFp.createUsersWithArrayInput(params)(fetch, basePath); }, /** @@ -1274,7 +1274,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param body List of user object */ - createUsersWithListInput(params: { body?: Array; }) { + createUsersWithListInput(params: { "body"?: Array; }) { return UserApiFp.createUsersWithListInput(params)(fetch, basePath); }, /** @@ -1282,7 +1282,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { username: string; }) { + deleteUser(params: { "username": string; }) { return UserApiFp.deleteUser(params)(fetch, basePath); }, /** @@ -1290,7 +1290,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { username: string; }) { + getUserByName(params: { "username": string; }) { return UserApiFp.getUserByName(params)(fetch, basePath); }, /** @@ -1299,7 +1299,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { username?: string; password?: string; }) { + loginUser(params: { "username"?: string; "password"?: string; }) { return UserApiFp.loginUser(params)(fetch, basePath); }, /** @@ -1315,7 +1315,7 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { username: string; body?: User; }) { + updateUser(params: { "username": string; "body"?: User; }) { return UserApiFp.updateUser(params)(fetch, basePath); }, }