diff --git a/bin/configs/typescript-angular-v13-provided-in-root-with-npm.yaml b/bin/configs/typescript-angular-v13-provided-in-root-with-npm.yaml index 22284f92f6c..dcf4d96d4dd 100644 --- a/bin/configs/typescript-angular-v13-provided-in-root-with-npm.yaml +++ b/bin/configs/typescript-angular-v13-provided-in-root-with-npm.yaml @@ -1,6 +1,6 @@ generatorName: typescript-angular outputDir: samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/typescript-angular additionalProperties: ngVersion: 13.0.1 diff --git a/bin/configs/typescript-angular-v13-provided-in-root.yaml b/bin/configs/typescript-angular-v13-provided-in-root.yaml index bf16e022ded..564081b45e9 100644 --- a/bin/configs/typescript-angular-v13-provided-in-root.yaml +++ b/bin/configs/typescript-angular-v13-provided-in-root.yaml @@ -1,6 +1,6 @@ generatorName: typescript-angular outputDir: samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/typescript-angular additionalProperties: ngVersion: 13.0.1 diff --git a/pom.xml b/pom.xml index ade8cc5e2c1..8af99164eb3 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,5 @@ - + org.sonatype.oss oss-parent @@ -290,7 +291,7 @@ - 1.8.0 + 1.8.0 3.2.5 @@ -1207,6 +1208,7 @@ samples/client/petstore/typescript-angular-v11-provided-in-root + samples/client/petstore/typescript-angular-v13-provided-in-root samples/openapi3/client/petstore/typescript/builds/default samples/openapi3/client/petstore/typescript/tests/default samples/openapi3/client/petstore/typescript/builds/jquery diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts index 23ec222806f..8d75c4d935b 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts @@ -103,16 +103,17 @@ 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 * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addPet.'); + public addPet(pet: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public addPet(pet: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public addPet(pet: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public addPet(pet: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling addPet.'); } let localVarHeaders = this.defaultHeaders; @@ -128,6 +129,8 @@ export class PetService { if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } @@ -162,8 +165,8 @@ export class PetService { } } - return this.httpClient.post(`${this.configuration.basePath}/pet`, - body, + return this.httpClient.post(`${this.configuration.basePath}/pet`, + pet, { context: localVarHttpContext, responseType: responseType_, @@ -177,6 +180,7 @@ export class PetService { /** * Deletes a pet + * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -457,16 +461,17 @@ 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 * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updatePet.'); + public updatePet(pet: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public updatePet(pet: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public updatePet(pet: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public updatePet(pet: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } let localVarHeaders = this.defaultHeaders; @@ -482,6 +487,8 @@ export class PetService { if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } @@ -516,8 +523,8 @@ export class PetService { } } - return this.httpClient.put(`${this.configuration.basePath}/pet`, - body, + return this.httpClient.put(`${this.configuration.basePath}/pet`, + pet, { context: localVarHttpContext, responseType: responseType_, @@ -531,6 +538,7 @@ export class PetService { /** * Updates a pet in the store with form data + * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -619,6 +627,7 @@ export class PetService { /** * uploads an image + * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts index 511c81f10d0..b9257c3ef8a 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts @@ -265,16 +265,17 @@ 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 * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + public placeOrder(order: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public placeOrder(order: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public placeOrder(order: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public placeOrder(order: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (order === null || order === undefined) { + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } let localVarHeaders = this.defaultHeaders; @@ -300,6 +301,7 @@ export class StoreService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -318,7 +320,7 @@ export class StoreService { } return this.httpClient.post(`${this.configuration.basePath}/store/order`, - body, + order, { context: localVarHttpContext, responseType: responseType_, diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts index a7783d4acc5..9889fe815b8 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts @@ -89,20 +89,27 @@ 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 * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUser.'); + public createUser(user: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUser(user: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUser(user: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUser(user: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUser.'); } let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header @@ -122,6 +129,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -140,7 +148,7 @@ export class UserService { } return this.httpClient.post(`${this.configuration.basePath}/user`, - body, + user, { context: localVarHttpContext, responseType: responseType_, @@ -154,20 +162,28 @@ export class UserService { /** * Creates list of users with given input array - * @param body List of user object + * + * @param user List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + public createUsersWithArrayInput(user: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUsersWithArrayInput(user: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithArrayInput(user: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithArrayInput(user: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header @@ -187,6 +203,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -205,7 +222,7 @@ export class UserService { } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, - body, + user, { context: localVarHttpContext, responseType: responseType_, @@ -219,20 +236,28 @@ export class UserService { /** * Creates list of users with given input array - * @param body List of user object + * + * @param user List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + public createUsersWithListInput(user: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUsersWithListInput(user: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithListInput(user: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithListInput(user: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header @@ -252,6 +277,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -270,7 +296,7 @@ export class UserService { } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, - body, + user, { context: localVarHttpContext, responseType: responseType_, @@ -299,6 +325,13 @@ export class UserService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header @@ -341,6 +374,7 @@ export class UserService { /** * Get user by user name + * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -399,6 +433,7 @@ export class UserService { /** * Logs user into the system + * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -472,6 +507,7 @@ export class UserService { /** * Logs out current logged in user session + * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -482,6 +518,13 @@ export class UserService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header @@ -526,23 +569,30 @@ 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 * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + public updateUser(username: string, user: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public updateUser(username: string, user: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updateUser(username: string, user: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updateUser(username: string, user: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateUser.'); + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling updateUser.'); } let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header @@ -562,6 +612,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -580,7 +631,7 @@ export class UserService { } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, - body, + user, { context: localVarHttpContext, responseType: responseType_, diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts index 23ec222806f..8d75c4d935b 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts @@ -103,16 +103,17 @@ 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 * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addPet.'); + public addPet(pet: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public addPet(pet: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public addPet(pet: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public addPet(pet: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling addPet.'); } let localVarHeaders = this.defaultHeaders; @@ -128,6 +129,8 @@ export class PetService { if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } @@ -162,8 +165,8 @@ export class PetService { } } - return this.httpClient.post(`${this.configuration.basePath}/pet`, - body, + return this.httpClient.post(`${this.configuration.basePath}/pet`, + pet, { context: localVarHttpContext, responseType: responseType_, @@ -177,6 +180,7 @@ export class PetService { /** * Deletes a pet + * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -457,16 +461,17 @@ 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 * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updatePet.'); + public updatePet(pet: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public updatePet(pet: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public updatePet(pet: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public updatePet(pet: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } let localVarHeaders = this.defaultHeaders; @@ -482,6 +487,8 @@ export class PetService { if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } @@ -516,8 +523,8 @@ export class PetService { } } - return this.httpClient.put(`${this.configuration.basePath}/pet`, - body, + return this.httpClient.put(`${this.configuration.basePath}/pet`, + pet, { context: localVarHttpContext, responseType: responseType_, @@ -531,6 +538,7 @@ export class PetService { /** * Updates a pet in the store with form data + * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -619,6 +627,7 @@ export class PetService { /** * uploads an image + * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts index 511c81f10d0..b9257c3ef8a 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts @@ -265,16 +265,17 @@ 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 * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + public placeOrder(order: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public placeOrder(order: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public placeOrder(order: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public placeOrder(order: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (order === null || order === undefined) { + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } let localVarHeaders = this.defaultHeaders; @@ -300,6 +301,7 @@ export class StoreService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -318,7 +320,7 @@ export class StoreService { } return this.httpClient.post(`${this.configuration.basePath}/store/order`, - body, + order, { context: localVarHttpContext, responseType: responseType_, diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts index a7783d4acc5..9889fe815b8 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts @@ -89,20 +89,27 @@ 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 * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUser.'); + public createUser(user: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUser(user: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUser(user: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUser(user: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUser.'); } let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header @@ -122,6 +129,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -140,7 +148,7 @@ export class UserService { } return this.httpClient.post(`${this.configuration.basePath}/user`, - body, + user, { context: localVarHttpContext, responseType: responseType_, @@ -154,20 +162,28 @@ export class UserService { /** * Creates list of users with given input array - * @param body List of user object + * + * @param user List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + public createUsersWithArrayInput(user: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUsersWithArrayInput(user: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithArrayInput(user: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithArrayInput(user: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header @@ -187,6 +203,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -205,7 +222,7 @@ export class UserService { } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, - body, + user, { context: localVarHttpContext, responseType: responseType_, @@ -219,20 +236,28 @@ export class UserService { /** * Creates list of users with given input array - * @param body List of user object + * + * @param user List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + public createUsersWithListInput(user: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUsersWithListInput(user: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithListInput(user: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithListInput(user: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header @@ -252,6 +277,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -270,7 +296,7 @@ export class UserService { } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, - body, + user, { context: localVarHttpContext, responseType: responseType_, @@ -299,6 +325,13 @@ export class UserService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header @@ -341,6 +374,7 @@ export class UserService { /** * Get user by user name + * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -399,6 +433,7 @@ export class UserService { /** * Logs user into the system + * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -472,6 +507,7 @@ export class UserService { /** * Logs out current logged in user session + * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -482,6 +518,13 @@ export class UserService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header @@ -526,23 +569,30 @@ 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 * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + public updateUser(username: string, user: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public updateUser(username: string, user: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updateUser(username: string, user: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updateUser(username: string, user: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateUser.'); + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling updateUser.'); } let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header @@ -562,6 +612,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -580,7 +631,7 @@ export class UserService { } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, - body, + user, { context: localVarHttpContext, responseType: responseType_, diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/pom.xml b/samples/client/petstore/typescript-angular-v13-provided-in-root/pom.xml new file mode 100644 index 00000000000..f3dacddf774 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/pom.xml @@ -0,0 +1,88 @@ + + 4.0.0 + org.openapitools + typescript-angular-v13-provided-in-root-tests + pom + 1.0-SNAPSHOT + + Typescript-Angular v13 Petstore Client + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + + withnpmm-npm-install + pre-integration-test + + exec + + + npm + builds/with-npm + + --legacy-peer-deps + install + + + + + + withnpmm-npm-run-build + pre-integration-test + + exec + + + npm + builds/with-npm + + run + build + + + + + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + + clean-typescript-angular-v13-test-outputs + + clean + + post-integration-test + + true + + + builds/with-npm + false + false + + dist/** + node_modules/** + package-lock.json + + + + + + + + + + +