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
This commit is contained in:
William Cheng 2018-04-27 22:12:13 +08:00 committed by GitHub
parent 6a98840199
commit 509fdd892b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 141 additions and 168 deletions

View File

@ -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);
}
}

View File

@ -1 +1 @@
2.4.0-SNAPSHOT
3.0.0-SNAPSHOT

View File

@ -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<any> {
// 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<any> {
// 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

View File

@ -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<Order> {
// 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();

View File

@ -22,21 +22,21 @@ import {
* createUser - parameters interface
*/
export interface ICreateUserParams {
body: User;
user: User;
}
/**
* createUsersWithArrayInput - parameters interface
*/
export interface ICreateUsersWithArrayInputParams {
body: Array<User>;
user: Array<User>;
}
/**
* createUsersWithListInput - parameters interface
*/
export interface ICreateUsersWithListInputParams {
body: Array<User>;
user: Array<User>;
}
/**
@ -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<any> {
// 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<any> {
// 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<any> {
// 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<User> {
// 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<any> {
// 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<any> {
// 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();

View File

@ -1 +1 @@
2.4.0-SNAPSHOT
3.0.0-SNAPSHOT

View File

@ -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<any>;
public addPet(body: Pet, observe?: 'response', headers?: Headers): Observable<HttpResponse<any>>;
public addPet(body: Pet, observe: any = 'body', headers: Headers = {}): Observable<any> {
if (!body){
throw new Error('Required parameter body was null or undefined when calling addPet.');
public addPet(pet: Pet, observe?: 'body', headers?: Headers): Observable<any>;
public addPet(pet: Pet, observe?: 'response', headers?: Headers): Observable<HttpResponse<any>>;
public addPet(pet: Pet, observe: any = 'body', headers: Headers = {}): Observable<any> {
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<HttpResponse<any>> = this.httpClient.post(`${this.basePath}/pet`, body , headers);
const response: Observable<HttpResponse<any>> = this.httpClient.post(`${this.basePath}/pet`, pet , headers);
if (observe == 'body') {
return response.map(httpResponse => <any>(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<HttpResponse<any>> = 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<any>;
public updatePet(body: Pet, observe?: 'response', headers?: Headers): Observable<HttpResponse<any>>;
public updatePet(body: Pet, observe: any = 'body', headers: Headers = {}): Observable<any> {
if (!body){
throw new Error('Required parameter body was null or undefined when calling updatePet.');
public updatePet(pet: Pet, observe?: 'body', headers?: Headers): Observable<any>;
public updatePet(pet: Pet, observe?: 'response', headers?: Headers): Observable<HttpResponse<any>>;
public updatePet(pet: Pet, observe: any = 'body', headers: Headers = {}): Observable<any> {
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<HttpResponse<any>> = this.httpClient.put(`${this.basePath}/pet`, body , headers);
const response: Observable<HttpResponse<any>> = this.httpClient.put(`${this.basePath}/pet`, pet , headers);
if (observe == 'body') {
return response.map(httpResponse => <any>(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';

View File

@ -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<HttpResponse<any>> = 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<Order>;
public placeOrder(body: Order, observe?: 'response', headers?: Headers): Observable<HttpResponse<Order>>;
public placeOrder(body: Order, observe: any = 'body', headers: Headers = {}): Observable<any> {
if (!body){
throw new Error('Required parameter body was null or undefined when calling placeOrder.');
public placeOrder(order: Order, observe?: 'body', headers?: Headers): Observable<Order>;
public placeOrder(order: Order, observe?: 'response', headers?: Headers): Observable<HttpResponse<Order>>;
public placeOrder(order: Order, observe: any = 'body', headers: Headers = {}): Observable<any> {
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<HttpResponse<Order>> = this.httpClient.post(`${this.basePath}/store/order`, body , headers);
const response: Observable<HttpResponse<Order>> = this.httpClient.post(`${this.basePath}/store/order`, order , headers);
if (observe == 'body') {
return response.map(httpResponse => <Order>(httpResponse.response));
}

View File

@ -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<any>;
public createUser(body: User, observe?: 'response', headers?: Headers): Observable<HttpResponse<any>>;
public createUser(body: User, observe: any = 'body', headers: Headers = {}): Observable<any> {
if (!body){
throw new Error('Required parameter body was null or undefined when calling createUser.');
public createUser(user: User, observe?: 'body', headers?: Headers): Observable<any>;
public createUser(user: User, observe?: 'response', headers?: Headers): Observable<HttpResponse<any>>;
public createUser(user: User, observe: any = 'body', headers: Headers = {}): Observable<any> {
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<HttpResponse<any>> = this.httpClient.post(`${this.basePath}/user`, body , headers);
const response: Observable<HttpResponse<any>> = this.httpClient.post(`${this.basePath}/user`, user , headers);
if (observe == 'body') {
return response.map(httpResponse => <any>(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<User>, observe?: 'body', headers?: Headers): Observable<any>;
public createUsersWithArrayInput(body: Array<User>, observe?: 'response', headers?: Headers): Observable<HttpResponse<any>>;
public createUsersWithArrayInput(body: Array<User>, observe: any = 'body', headers: Headers = {}): Observable<any> {
if (!body){
throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.');
public createUsersWithArrayInput(user: Array<User>, observe?: 'body', headers?: Headers): Observable<any>;
public createUsersWithArrayInput(user: Array<User>, observe?: 'response', headers?: Headers): Observable<HttpResponse<any>>;
public createUsersWithArrayInput(user: Array<User>, observe: any = 'body', headers: Headers = {}): Observable<any> {
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<HttpResponse<any>> = this.httpClient.post(`${this.basePath}/user/createWithArray`, body , headers);
const response: Observable<HttpResponse<any>> = this.httpClient.post(`${this.basePath}/user/createWithArray`, user , headers);
if (observe == 'body') {
return response.map(httpResponse => <any>(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<User>, observe?: 'body', headers?: Headers): Observable<any>;
public createUsersWithListInput(body: Array<User>, observe?: 'response', headers?: Headers): Observable<HttpResponse<any>>;
public createUsersWithListInput(body: Array<User>, observe: any = 'body', headers: Headers = {}): Observable<any> {
if (!body){
throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.');
public createUsersWithListInput(user: Array<User>, observe?: 'body', headers?: Headers): Observable<any>;
public createUsersWithListInput(user: Array<User>, observe?: 'response', headers?: Headers): Observable<HttpResponse<any>>;
public createUsersWithListInput(user: Array<User>, observe: any = 'body', headers: Headers = {}): Observable<any> {
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<HttpResponse<any>> = this.httpClient.post(`${this.basePath}/user/createWithList`, body , headers);
const response: Observable<HttpResponse<any>> = this.httpClient.post(`${this.basePath}/user/createWithList`, user , headers);
if (observe == 'body') {
return response.map(httpResponse => <any>(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<HttpResponse<any>> = 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<any>;
public logoutUser(observe?: 'response', headers?: Headers): Observable<HttpResponse<any>>;
public logoutUser(observe: any = 'body', headers: Headers = {}): Observable<any> {
headers['Accept'] = 'application/xml';
headers['Accept'] = 'application/json';
const response: Observable<HttpResponse<any>> = 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<any>;
public updateUser(username: string, body: User, observe?: 'response', headers?: Headers): Observable<HttpResponse<any>>;
public updateUser(username: string, body: User, observe: any = 'body', headers: Headers = {}): Observable<any> {
public updateUser(username: string, user: User, observe?: 'body', headers?: Headers): Observable<any>;
public updateUser(username: string, user: User, observe?: 'response', headers?: Headers): Observable<HttpResponse<any>>;
public updateUser(username: string, user: User, observe: any = 'body', headers: Headers = {}): Observable<any> {
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<HttpResponse<any>> = this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, body , headers);
const response: Observable<HttpResponse<any>> = this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, user , headers);
if (observe == 'body') {
return response.map(httpResponse => <any>(httpResponse.response));
}

View File

@ -1 +1 @@
2.4.0-SNAPSHOT
3.0.0-SNAPSHOT

View File

@ -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

View File

@ -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'];
}

View File

@ -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<models.User>, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> {
public createUsersWithArrayInput(modelsUser: Array<models.User>, 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<models.User>, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> {
public createUsersWithListInput(modelsUser: Array<models.User>, 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'];
}