From 509fdd892b19841f18016dfd2a0116e1a3b81ac1 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 27 Apr 2018 22:12:13 +0800 Subject: [PATCH] Update TypeScript jQuery, Aurelia, Inversify with Petstore OAS2 (#248) * update ts inversify with petstore oas2 * update typescript-aurelia petstore with oas2 * update ts jquery with oas2 --- .../TypeScriptJqueryClientCodegen.java | 6 ++ .../default/.openapi-generator/VERSION | 2 +- .../typescript-aurelia/default/PetApi.ts | 21 +++--- .../typescript-aurelia/default/StoreApi.ts | 9 ++- .../typescript-aurelia/default/UserApi.ts | 39 +++++------ .../.openapi-generator/VERSION | 2 +- .../typescript-inversify/api/pet.service.ts | 36 +++++----- .../typescript-inversify/api/store.service.ts | 16 ++--- .../typescript-inversify/api/user.service.ts | 68 +++++++++---------- .../npm/.openapi-generator/VERSION | 2 +- .../typescript-jquery/npm/api/PetApi.ts | 32 ++++----- .../typescript-jquery/npm/api/StoreApi.ts | 14 ++-- .../typescript-jquery/npm/api/UserApi.ts | 62 +++++++---------- 13 files changed, 141 insertions(+), 168 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptJqueryClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptJqueryClientCodegen.java index d449aae45f..c25b517ca1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptJqueryClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptJqueryClientCodegen.java @@ -116,6 +116,11 @@ public class TypeScriptJqueryClientCodegen extends AbstractTypeScriptClientCodeg return addModelPrefix(openAPIType); } + @Override + public String getTypeDeclaration(String name) { + return addModelPrefix(name); + } + @Override public void postProcessParameter(CodegenParameter parameter) { super.postProcessParameter(parameter); @@ -193,4 +198,5 @@ public class TypeScriptJqueryClientCodegen extends AbstractTypeScriptClientCodeg return indexPackage.replace('.', File.separatorChar); } + } diff --git a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION index 855ff9501e..096bf47efe 100644 --- a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-aurelia/default/PetApi.ts b/samples/client/petstore/typescript-aurelia/default/PetApi.ts index 278c70e7c8..d9407cf170 100644 --- a/samples/client/petstore/typescript-aurelia/default/PetApi.ts +++ b/samples/client/petstore/typescript-aurelia/default/PetApi.ts @@ -23,7 +23,7 @@ import { * addPet - parameters interface */ export interface IAddPetParams { - body: Pet; + pet: Pet; } /** @@ -59,7 +59,7 @@ export interface IGetPetByIdParams { * updatePet - parameters interface */ export interface IUpdatePetParams { - body: Pet; + pet: Pet; } /** @@ -98,12 +98,11 @@ export class PetApi extends Api { /** * Add a new pet to the store - * - * @param params.body Pet object that needs to be added to the store + * @param params.pet Pet object that needs to be added to the store */ async addPet(params: IAddPetParams): Promise { // Verify required parameters are set - this.ensureParamIsSet('addPet', params, 'body'); + this.ensureParamIsSet('addPet', params, 'pet'); // Create URL to call const url = `${this.basePath}/pet`; @@ -113,7 +112,7 @@ export class PetApi extends Api { .asPost() // Encode body parameter .withHeader('content-type', 'application/json') - .withContent(JSON.stringify(params['body'] || {})) + .withContent(JSON.stringify(params['pet'] || {})) // Authentication 'petstore_auth' required // Send the request @@ -129,7 +128,6 @@ export class PetApi extends Api { /** * Deletes a pet - * * @param params.petId Pet id to delete * @param params.apiKey */ @@ -253,12 +251,11 @@ export class PetApi extends Api { /** * Update an existing pet - * - * @param params.body Pet object that needs to be added to the store + * @param params.pet Pet object that needs to be added to the store */ async updatePet(params: IUpdatePetParams): Promise { // Verify required parameters are set - this.ensureParamIsSet('updatePet', params, 'body'); + this.ensureParamIsSet('updatePet', params, 'pet'); // Create URL to call const url = `${this.basePath}/pet`; @@ -268,7 +265,7 @@ export class PetApi extends Api { .asPut() // Encode body parameter .withHeader('content-type', 'application/json') - .withContent(JSON.stringify(params['body'] || {})) + .withContent(JSON.stringify(params['pet'] || {})) // Authentication 'petstore_auth' required // Send the request @@ -284,7 +281,6 @@ export class PetApi extends Api { /** * Updates a pet in the store with form data - * * @param params.petId ID of pet that needs to be updated * @param params.name Updated name of the pet * @param params.status Updated status of the pet @@ -321,7 +317,6 @@ export class PetApi extends Api { /** * uploads an image - * * @param params.petId ID of pet to update * @param params.additionalMetadata Additional data to pass to server * @param params.file file to upload diff --git a/samples/client/petstore/typescript-aurelia/default/StoreApi.ts b/samples/client/petstore/typescript-aurelia/default/StoreApi.ts index c175433fa7..bffa5513eb 100644 --- a/samples/client/petstore/typescript-aurelia/default/StoreApi.ts +++ b/samples/client/petstore/typescript-aurelia/default/StoreApi.ts @@ -42,7 +42,7 @@ export interface IGetOrderByIdParams { * placeOrder - parameters interface */ export interface IPlaceOrderParams { - body: Order; + order: Order; } /** @@ -146,12 +146,11 @@ export class StoreApi extends Api { /** * Place an order for a pet - * - * @param params.body order placed for purchasing the pet + * @param params.order order placed for purchasing the pet */ async placeOrder(params: IPlaceOrderParams): Promise { // Verify required parameters are set - this.ensureParamIsSet('placeOrder', params, 'body'); + this.ensureParamIsSet('placeOrder', params, 'order'); // Create URL to call const url = `${this.basePath}/store/order`; @@ -161,7 +160,7 @@ export class StoreApi extends Api { .asPost() // Encode body parameter .withHeader('content-type', 'application/json') - .withContent(JSON.stringify(params['body'] || {})) + .withContent(JSON.stringify(params['order'] || {})) // Send the request .send(); diff --git a/samples/client/petstore/typescript-aurelia/default/UserApi.ts b/samples/client/petstore/typescript-aurelia/default/UserApi.ts index 2c4cbc1361..6c3bb2c0bf 100644 --- a/samples/client/petstore/typescript-aurelia/default/UserApi.ts +++ b/samples/client/petstore/typescript-aurelia/default/UserApi.ts @@ -22,21 +22,21 @@ import { * createUser - parameters interface */ export interface ICreateUserParams { - body: User; + user: User; } /** * createUsersWithArrayInput - parameters interface */ export interface ICreateUsersWithArrayInputParams { - body: Array; + user: Array; } /** * createUsersWithListInput - parameters interface */ export interface ICreateUsersWithListInputParams { - body: Array; + user: Array; } /** @@ -72,7 +72,7 @@ export interface ILogoutUserParams { */ export interface IUpdateUserParams { username: string; - body: User; + user: User; } /** @@ -94,11 +94,11 @@ export class UserApi extends Api { /** * Create user * This can only be done by the logged in user. - * @param params.body Created user object + * @param params.user Created user object */ async createUser(params: ICreateUserParams): Promise { // Verify required parameters are set - this.ensureParamIsSet('createUser', params, 'body'); + this.ensureParamIsSet('createUser', params, 'user'); // Create URL to call const url = `${this.basePath}/user`; @@ -108,7 +108,7 @@ export class UserApi extends Api { .asPost() // Encode body parameter .withHeader('content-type', 'application/json') - .withContent(JSON.stringify(params['body'] || {})) + .withContent(JSON.stringify(params['user'] || {})) // Send the request .send(); @@ -123,12 +123,11 @@ export class UserApi extends Api { /** * Creates list of users with given input array - * - * @param params.body List of user object + * @param params.user List of user object */ async createUsersWithArrayInput(params: ICreateUsersWithArrayInputParams): Promise { // Verify required parameters are set - this.ensureParamIsSet('createUsersWithArrayInput', params, 'body'); + this.ensureParamIsSet('createUsersWithArrayInput', params, 'user'); // Create URL to call const url = `${this.basePath}/user/createWithArray`; @@ -138,7 +137,7 @@ export class UserApi extends Api { .asPost() // Encode body parameter .withHeader('content-type', 'application/json') - .withContent(JSON.stringify(params['body'] || {})) + .withContent(JSON.stringify(params['user'] || {})) // Send the request .send(); @@ -153,12 +152,11 @@ export class UserApi extends Api { /** * Creates list of users with given input array - * - * @param params.body List of user object + * @param params.user List of user object */ async createUsersWithListInput(params: ICreateUsersWithListInputParams): Promise { // Verify required parameters are set - this.ensureParamIsSet('createUsersWithListInput', params, 'body'); + this.ensureParamIsSet('createUsersWithListInput', params, 'user'); // Create URL to call const url = `${this.basePath}/user/createWithList`; @@ -168,7 +166,7 @@ export class UserApi extends Api { .asPost() // Encode body parameter .withHeader('content-type', 'application/json') - .withContent(JSON.stringify(params['body'] || {})) + .withContent(JSON.stringify(params['user'] || {})) // Send the request .send(); @@ -211,8 +209,7 @@ export class UserApi extends Api { /** * Get user by user name - * - * @param params.username The name that needs to be fetched. Use user1 for testing. + * @param params.username The name that needs to be fetched. Use user1 for testing. */ async getUserByName(params: IGetUserByNameParams): Promise { // Verify required parameters are set @@ -239,7 +236,6 @@ export class UserApi extends Api { /** * Logs user into the system - * * @param params.username The user name for login * @param params.password The password for login in clear text */ @@ -273,7 +269,6 @@ export class UserApi extends Api { /** * Logs out current logged in user session - * */ async logoutUser(): Promise { // Verify required parameters are set @@ -300,12 +295,12 @@ export class UserApi extends Api { * Updated user * This can only be done by the logged in user. * @param params.username name that need to be deleted - * @param params.body Updated user object + * @param params.user Updated user object */ async updateUser(params: IUpdateUserParams): Promise { // Verify required parameters are set this.ensureParamIsSet('updateUser', params, 'username'); - this.ensureParamIsSet('updateUser', params, 'body'); + this.ensureParamIsSet('updateUser', params, 'user'); // Create URL to call const url = `${this.basePath}/user/{username}` @@ -316,7 +311,7 @@ export class UserApi extends Api { .asPut() // Encode body parameter .withHeader('content-type', 'application/json') - .withContent(JSON.stringify(params['body'] || {})) + .withContent(JSON.stringify(params['user'] || {})) // Send the request .send(); diff --git a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION index 855ff9501e..096bf47efe 100644 --- a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-inversify/api/pet.service.ts b/samples/client/petstore/typescript-inversify/api/pet.service.ts index b52d0f56cf..5eae03ff4f 100644 --- a/samples/client/petstore/typescript-inversify/api/pet.service.ts +++ b/samples/client/petstore/typescript-inversify/api/pet.service.ts @@ -40,14 +40,14 @@ export class PetService { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public addPet(body: Pet, observe?: 'body', headers?: Headers): Observable; - public addPet(body: Pet, observe?: 'response', headers?: Headers): Observable>; - public addPet(body: Pet, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ - throw new Error('Required parameter body was null or undefined when calling addPet.'); + public addPet(pet: Pet, observe?: 'body', headers?: Headers): Observable; + public addPet(pet: Pet, observe?: 'response', headers?: Headers): Observable>; + public addPet(pet: Pet, observe: any = 'body', headers: Headers = {}): Observable { + if (!pet){ + throw new Error('Required parameter pet was null or undefined when calling addPet.'); } // authentication (petstore_auth) required @@ -57,10 +57,10 @@ export class PetService { : this.APIConfiguration.accessToken; headers['Authorization'] = 'Bearer ' + accessToken; } - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/json'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.post(`${this.basePath}/pet`, body , headers); + const response: Observable> = this.httpClient.post(`${this.basePath}/pet`, pet , headers); if (observe == 'body') { return response.map(httpResponse => (httpResponse.response)); } @@ -93,7 +93,7 @@ export class PetService { : this.APIConfiguration.accessToken; headers['Authorization'] = 'Bearer ' + accessToken; } - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/json'; const response: Observable> = this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, headers); if (observe == 'body') { @@ -203,14 +203,14 @@ export class PetService { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public updatePet(body: Pet, observe?: 'body', headers?: Headers): Observable; - public updatePet(body: Pet, observe?: 'response', headers?: Headers): Observable>; - public updatePet(body: Pet, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ - throw new Error('Required parameter body was null or undefined when calling updatePet.'); + public updatePet(pet: Pet, observe?: 'body', headers?: Headers): Observable; + public updatePet(pet: Pet, observe?: 'response', headers?: Headers): Observable>; + public updatePet(pet: Pet, observe: any = 'body', headers: Headers = {}): Observable { + if (!pet){ + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } // authentication (petstore_auth) required @@ -220,10 +220,10 @@ export class PetService { : this.APIConfiguration.accessToken; headers['Authorization'] = 'Bearer ' + accessToken; } - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/json'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.put(`${this.basePath}/pet`, body , headers); + const response: Observable> = this.httpClient.put(`${this.basePath}/pet`, pet , headers); if (observe == 'body') { return response.map(httpResponse => (httpResponse.response)); } @@ -253,7 +253,7 @@ export class PetService { : this.APIConfiguration.accessToken; headers['Authorization'] = 'Bearer ' + accessToken; } - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/json'; let formData: FormData = new FormData(); headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'; diff --git a/samples/client/petstore/typescript-inversify/api/store.service.ts b/samples/client/petstore/typescript-inversify/api/store.service.ts index 0185d32f2a..9d5cd3ba85 100644 --- a/samples/client/petstore/typescript-inversify/api/store.service.ts +++ b/samples/client/petstore/typescript-inversify/api/store.service.ts @@ -49,7 +49,7 @@ export class StoreService { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/json'; const response: Observable> = this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, headers); if (observe == 'body') { @@ -107,20 +107,20 @@ export class StoreService { /** * Place an order for a pet * - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public placeOrder(body: Order, observe?: 'body', headers?: Headers): Observable; - public placeOrder(body: Order, observe?: 'response', headers?: Headers): Observable>; - public placeOrder(body: Order, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ - throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + public placeOrder(order: Order, observe?: 'body', headers?: Headers): Observable; + public placeOrder(order: Order, observe?: 'response', headers?: Headers): Observable>; + public placeOrder(order: Order, observe: any = 'body', headers: Headers = {}): Observable { + if (!order){ + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } headers['Accept'] = 'application/xml'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.post(`${this.basePath}/store/order`, body , headers); + const response: Observable> = this.httpClient.post(`${this.basePath}/store/order`, order , headers); if (observe == 'body') { return response.map(httpResponse => (httpResponse.response)); } diff --git a/samples/client/petstore/typescript-inversify/api/user.service.ts b/samples/client/petstore/typescript-inversify/api/user.service.ts index 3a794603bf..91df895f66 100644 --- a/samples/client/petstore/typescript-inversify/api/user.service.ts +++ b/samples/client/petstore/typescript-inversify/api/user.service.ts @@ -39,20 +39,20 @@ export class UserService { /** * Create user * This can only be done by the logged in user. - * @param body Created user object + * @param user Created user object */ - public createUser(body: User, observe?: 'body', headers?: Headers): Observable; - public createUser(body: User, observe?: 'response', headers?: Headers): Observable>; - public createUser(body: User, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ - throw new Error('Required parameter body was null or undefined when calling createUser.'); + public createUser(user: User, observe?: 'body', headers?: Headers): Observable; + public createUser(user: User, observe?: 'response', headers?: Headers): Observable>; + public createUser(user: User, observe: any = 'body', headers: Headers = {}): Observable { + if (!user){ + throw new Error('Required parameter user was null or undefined when calling createUser.'); } - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/json'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.post(`${this.basePath}/user`, body , headers); + const response: Observable> = this.httpClient.post(`${this.basePath}/user`, user , headers); if (observe == 'body') { return response.map(httpResponse => (httpResponse.response)); } @@ -63,20 +63,20 @@ export class UserService { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - public createUsersWithArrayInput(body: Array, observe?: 'body', headers?: Headers): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', headers?: Headers): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ - throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + public createUsersWithArrayInput(user: Array, observe?: 'body', headers?: Headers): Observable; + public createUsersWithArrayInput(user: Array, observe?: 'response', headers?: Headers): Observable>; + public createUsersWithArrayInput(user: Array, observe: any = 'body', headers: Headers = {}): Observable { + if (!user){ + throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/json'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.post(`${this.basePath}/user/createWithArray`, body , headers); + const response: Observable> = this.httpClient.post(`${this.basePath}/user/createWithArray`, user , headers); if (observe == 'body') { return response.map(httpResponse => (httpResponse.response)); } @@ -87,20 +87,20 @@ export class UserService { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - public createUsersWithListInput(body: Array, observe?: 'body', headers?: Headers): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', headers?: Headers): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ - throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + public createUsersWithListInput(user: Array, observe?: 'body', headers?: Headers): Observable; + public createUsersWithListInput(user: Array, observe?: 'response', headers?: Headers): Observable>; + public createUsersWithListInput(user: Array, observe: any = 'body', headers: Headers = {}): Observable { + if (!user){ + throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/json'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.post(`${this.basePath}/user/createWithList`, body , headers); + const response: Observable> = this.httpClient.post(`${this.basePath}/user/createWithList`, user , headers); if (observe == 'body') { return response.map(httpResponse => (httpResponse.response)); } @@ -121,7 +121,7 @@ export class UserService { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/json'; const response: Observable> = this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, headers); if (observe == 'body') { @@ -198,7 +198,7 @@ export class UserService { public logoutUser(observe?: 'body', headers?: Headers): Observable; public logoutUser(observe?: 'response', headers?: Headers): Observable>; public logoutUser(observe: any = 'body', headers: Headers = {}): Observable { - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/json'; const response: Observable> = this.httpClient.get(`${this.basePath}/user/logout`, headers); if (observe == 'body') { @@ -212,24 +212,24 @@ export class UserService { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - public updateUser(username: string, body: User, observe?: 'body', headers?: Headers): Observable; - public updateUser(username: string, body: User, observe?: 'response', headers?: Headers): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', headers: Headers = {}): Observable { + public updateUser(username: string, user: User, observe?: 'body', headers?: Headers): Observable; + public updateUser(username: string, user: User, observe?: 'response', headers?: Headers): Observable>; + public updateUser(username: string, user: User, observe: any = 'body', headers: Headers = {}): Observable { if (!username){ throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - if (!body){ - throw new Error('Required parameter body was null or undefined when calling updateUser.'); + if (!user){ + throw new Error('Required parameter user was null or undefined when calling updateUser.'); } - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/json'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, body , headers); + const response: Observable> = this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, user , headers); if (observe == 'body') { return response.map(httpResponse => (httpResponse.response)); } diff --git a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION index 855ff9501e..096bf47efe 100644 --- a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts b/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts index 68203071fd..af6f55c56b 100644 --- a/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts +++ b/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts @@ -49,16 +49,16 @@ export class PetApi { /** * * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public addPet(body: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public addPet(pet: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/pet'; let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addPet.'); + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling addPet.'); } @@ -71,8 +71,6 @@ export class PetApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', - 'application/json' ]; // authentication (petstore_auth) required @@ -94,7 +92,7 @@ export class PetApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(pet); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -143,8 +141,6 @@ export class PetApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', - 'application/json' ]; // authentication (petstore_auth) required @@ -389,16 +385,16 @@ export class PetApi { /** * * @summary Update an existing pet - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public updatePet(body: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public updatePet(pet: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/pet'; let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updatePet.'); + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } @@ -411,8 +407,6 @@ export class PetApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', - 'application/json' ]; // authentication (petstore_auth) required @@ -434,7 +428,7 @@ export class PetApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(pet); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -492,8 +486,6 @@ export class PetApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', - 'application/json' ]; // authentication (petstore_auth) required diff --git a/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts b/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts index 1a7b91c282..4621027ca3 100644 --- a/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts +++ b/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts @@ -69,8 +69,6 @@ export class StoreApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', - 'application/json' ]; @@ -218,16 +216,16 @@ export class StoreApi { /** * * @summary Place an order for a pet - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public placeOrder(body: models.Order, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.Order; }> { + public placeOrder(order: models.Order, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.Order; }> { let localVarPath = this.basePath + '/store/order'; let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + // verify required parameter 'order' is not null or undefined + if (order === null || order === undefined) { + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } @@ -252,7 +250,7 @@ export class StoreApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(order); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } diff --git a/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts b/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts index 3e8308dac3..a98e7c5e3f 100644 --- a/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts +++ b/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts @@ -49,16 +49,16 @@ export class UserApi { /** * This can only be done by the logged in user. * @summary Create user - * @param body Created user object + * @param user Created user object */ - public createUser(body: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public createUser(user: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/user'; let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUser.'); + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUser.'); } @@ -69,8 +69,6 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', - 'application/json' ]; @@ -83,7 +81,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(user); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -109,16 +107,16 @@ export class UserApi { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param modelsUser List of user object */ - public createUsersWithArrayInput(body: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public createUsersWithArrayInput(modelsUser: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/user/createWithArray'; let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + // verify required parameter 'modelsUser' is not null or undefined + if (modelsUser === null || modelsUser === undefined) { + throw new Error('Required parameter modelsUser was null or undefined when calling createUsersWithArrayInput.'); } @@ -129,8 +127,6 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', - 'application/json' ]; @@ -143,7 +139,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(modelsUser); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -169,16 +165,16 @@ export class UserApi { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param modelsUser List of user object */ - public createUsersWithListInput(body: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public createUsersWithListInput(modelsUser: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/user/createWithList'; let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + // verify required parameter 'modelsUser' is not null or undefined + if (modelsUser === null || modelsUser === undefined) { + throw new Error('Required parameter modelsUser was null or undefined when calling createUsersWithListInput.'); } @@ -189,8 +185,6 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', - 'application/json' ]; @@ -203,7 +197,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(modelsUser); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -249,8 +243,6 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', - 'application/json' ]; @@ -286,7 +278,7 @@ export class UserApi { /** * * @summary Get user by user name - * @param username The name that needs to be fetched. Use user1 for testing. + * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByName(username: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.User; }> { let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', encodeURIComponent(String(username))); @@ -426,8 +418,6 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', - 'application/json' ]; @@ -464,9 +454,9 @@ export class UserApi { * This can only be done by the logged in user. * @summary Updated user * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - public updateUser(username: string, body: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public updateUser(username: string, user: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; @@ -476,9 +466,9 @@ export class UserApi { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateUser.'); + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling updateUser.'); } @@ -489,8 +479,6 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', - 'application/json' ]; @@ -503,7 +491,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(user); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; }