diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularJsClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularJsClientCodegen.java index a2c464d12bc..4940f526442 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularJsClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularJsClientCodegen.java @@ -61,6 +61,11 @@ public class TypeScriptAngularJsClientCodegen extends AbstractTypeScriptClientCo return addModelPrefix(openAPIType); } + @Override + public String getTypeDeclaration(String name) { + return addModelPrefix(name); + } + @Override public void postProcessParameter(CodegenParameter parameter) { super.postProcessParameter(parameter); diff --git a/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION b/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION index a6254504e40..096bf47efe3 100644 --- a/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION @@ -1 +1 @@ -2.3.1 \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angularjs/api/PetApi.ts b/samples/client/petstore/typescript-angularjs/api/PetApi.ts index 8991c0b3862..2166bc2f6f5 100644 --- a/samples/client/petstore/typescript-angularjs/api/PetApi.ts +++ b/samples/client/petstore/typescript-angularjs/api/PetApi.ts @@ -29,22 +29,22 @@ 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, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { + public addPet (pet: models.Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/pet'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); - // 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.'); } let httpRequestParams: ng.IRequestConfig = { method: 'POST', url: localVarPath, - data: body, + data: pet, params: queryParameters, headers: headerParams }; @@ -183,22 +183,22 @@ 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, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { + public updatePet (pet: models.Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/pet'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); - // 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.'); } let httpRequestParams: ng.IRequestConfig = { method: 'PUT', url: localVarPath, - data: body, + data: pet, params: queryParameters, headers: headerParams }; diff --git a/samples/client/petstore/typescript-angularjs/api/StoreApi.ts b/samples/client/petstore/typescript-angularjs/api/StoreApi.ts index 6ac29c56660..5e92a6848fa 100644 --- a/samples/client/petstore/typescript-angularjs/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angularjs/api/StoreApi.ts @@ -109,22 +109,22 @@ 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, extraHttpRequestParams?: any ) : ng.IHttpPromise { + public placeOrder (order: models.Order, extraHttpRequestParams?: any ) : ng.IHttpPromise { const localVarPath = this.basePath + '/store/order'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); - // 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.'); } let httpRequestParams: ng.IRequestConfig = { method: 'POST', url: localVarPath, - data: body, + data: order, params: queryParameters, headers: headerParams }; diff --git a/samples/client/petstore/typescript-angularjs/api/UserApi.ts b/samples/client/petstore/typescript-angularjs/api/UserApi.ts index d846cf25afc..e774b24cb11 100644 --- a/samples/client/petstore/typescript-angularjs/api/UserApi.ts +++ b/samples/client/petstore/typescript-angularjs/api/UserApi.ts @@ -29,22 +29,22 @@ 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, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { + public createUser (user: models.User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/user'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); - // 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.'); } let httpRequestParams: ng.IRequestConfig = { method: 'POST', url: localVarPath, - data: body, + data: user, params: queryParameters, headers: headerParams }; @@ -58,22 +58,22 @@ 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, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { + public createUsersWithArrayInput (modelsUser: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/user/createWithArray'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); - // 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.'); } let httpRequestParams: ng.IRequestConfig = { method: 'POST', url: localVarPath, - data: body, + data: modelsUser, params: queryParameters, headers: headerParams }; @@ -87,22 +87,22 @@ 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, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { + public createUsersWithListInput (modelsUser: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/user/createWithList'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); - // 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.'); } let httpRequestParams: ng.IRequestConfig = { method: 'POST', url: localVarPath, - data: body, + data: modelsUser, params: queryParameters, headers: headerParams }; @@ -145,7 +145,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, extraHttpRequestParams?: any ) : ng.IHttpPromise { const localVarPath = this.basePath + '/user/{username}' @@ -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 body Updated user object + * @param user Updated user object */ - public updateUser (username: string, body: models.User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { + public updateUser (username: string, user: models.User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/user/{username}' .replace('{' + 'username' + '}', encodeURIComponent(String(username))); @@ -252,15 +252,15 @@ 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.'); } let httpRequestParams: ng.IRequestConfig = { method: 'PUT', url: localVarPath, - data: body, + data: user, params: queryParameters, headers: headerParams };