Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Typescript AngularJS] fix Extra package prefix in api parameters operations #2522

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bin/utils/ensure-up-to-date
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ declare -a scripts=(
"./bin/php-slim-server-petstore.sh"
"./bin/php-ze-ph-petstore-server.sh"
"./bin/openapi3/php-petstore.sh"
"./bin/typescript-angularjs-petstore.sh"
"./bin/typescript-angular-petstore-all.sh"
"./bin/typescript-axios-petstore-all.sh"
"./bin/typescript-fetch-petstore-all.sh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public String getTypeDeclaration(String name) {
@Override
public void postProcessParameter(CodegenParameter parameter) {
super.postProcessParameter(parameter);
parameter.dataType = addModelPrefix(parameter.dataType);
// parameter.dataType = addModelPrefix(parameter.dataType);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove that (commented code) later with another PR when I've time

}

private String getIndexDirectory() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.0-SNAPSHOT
4.0.0-SNAPSHOT
24 changes: 12 additions & 12 deletions samples/client/petstore/typescript-angularjs/api/PetApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ export class PetApi {
/**
*
* @summary Add a new pet to the store
* @param pet Pet object that needs to be added to the store
* @param body Pet object that needs to be added to the store
*/
public addPet (pet: models.models.Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
public addPet (body: models.Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const localVarPath = this.basePath + '/pet';

let queryParameters: any = {};
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
// 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.');
// 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.');
}

let httpRequestParams: ng.IRequestConfig = {
method: 'POST',
url: localVarPath,
data: pet,
data: body,
params: queryParameters,
headers: headerParams
};
Expand Down Expand Up @@ -183,22 +183,22 @@ export class PetApi {
/**
*
* @summary Update an existing pet
* @param pet Pet object that needs to be added to the store
* @param body Pet object that needs to be added to the store
*/
public updatePet (pet: models.models.Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
public updatePet (body: models.Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const localVarPath = this.basePath + '/pet';

let queryParameters: any = {};
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
// 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.');
// 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.');
}

let httpRequestParams: ng.IRequestConfig = {
method: 'PUT',
url: localVarPath,
data: pet,
data: body,
params: queryParameters,
headers: headerParams
};
Expand Down
12 changes: 6 additions & 6 deletions samples/client/petstore/typescript-angularjs/api/StoreApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,22 +109,22 @@ export class StoreApi {
/**
*
* @summary Place an order for a pet
* @param order order placed for purchasing the pet
* @param body order placed for purchasing the pet
*/
public placeOrder (order: models.models.Order, extraHttpRequestParams?: any ) : ng.IHttpPromise<models.Order> {
public placeOrder (body: models.Order, extraHttpRequestParams?: any ) : ng.IHttpPromise<models.Order> {
const localVarPath = this.basePath + '/store/order';

let queryParameters: any = {};
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
// 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.');
// 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.');
}

let httpRequestParams: ng.IRequestConfig = {
method: 'POST',
url: localVarPath,
data: order,
data: body,
params: queryParameters,
headers: headerParams
};
Expand Down
48 changes: 24 additions & 24 deletions samples/client/petstore/typescript-angularjs/api/UserApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ export class UserApi {
/**
* This can only be done by the logged in user.
* @summary Create user
* @param user Created user object
* @param body Created user object
*/
public createUser (user: models.models.User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
public createUser (body: models.User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const localVarPath = this.basePath + '/user';

let queryParameters: any = {};
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
// 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.');
// 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.');
}

let httpRequestParams: ng.IRequestConfig = {
method: 'POST',
url: localVarPath,
data: user,
data: body,
params: queryParameters,
headers: headerParams
};
Expand All @@ -58,22 +58,22 @@ export class UserApi {
/**
*
* @summary Creates list of users with given input array
* @param modelsUser List of user object
* @param body List of user object
*/
public createUsersWithArrayInput (modelsUser: Array<models.User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
public createUsersWithArrayInput (body: Array<models.User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const localVarPath = this.basePath + '/user/createWithArray';

let queryParameters: any = {};
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
// 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.');
// 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.');
}

let httpRequestParams: ng.IRequestConfig = {
method: 'POST',
url: localVarPath,
data: modelsUser,
data: body,
params: queryParameters,
headers: headerParams
};
Expand All @@ -87,22 +87,22 @@ export class UserApi {
/**
*
* @summary Creates list of users with given input array
* @param modelsUser List of user object
* @param body List of user object
*/
public createUsersWithListInput (modelsUser: Array<models.User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
public createUsersWithListInput (body: Array<models.User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const localVarPath = this.basePath + '/user/createWithList';

let queryParameters: any = {};
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
// 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.');
// 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.');
}

let httpRequestParams: ng.IRequestConfig = {
method: 'POST',
url: localVarPath,
data: modelsUser,
data: body,
params: queryParameters,
headers: headerParams
};
Expand Down Expand Up @@ -239,9 +239,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 user Updated user object
* @param body Updated user object
*/
public updateUser (username: string, user: models.models.User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
public updateUser (username: string, body: models.User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const localVarPath = this.basePath + '/user/{username}'
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));

Expand All @@ -252,15 +252,15 @@ export class UserApi {
throw new Error('Required parameter username 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.');
// 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.');
}

let httpRequestParams: ng.IRequestConfig = {
method: 'PUT',
url: localVarPath,
data: user,
data: body,
params: queryParameters,
headers: headerParams
};
Expand Down