From 87cb779fd465a0ba50cfd55684ed56fe7bbcddd8 Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 1 Dec 2016 19:09:22 +0800 Subject: [PATCH] [Typscript][Angular2] Remove tab in TS Angular2 template (#4294) * remove tab in ts angular2 template * update petstore sample after basing on master --- .../resources/typescript-angular2/api.mustache | 8 ++++---- .../typescript-angular2/default/api/PetApi.ts | 14 +++++++------- .../typescript-angular2/default/api/StoreApi.ts | 4 ++-- .../typescript-angular2/default/api/UserApi.ts | 4 ++-- .../petstore/typescript-angular2/npm/README.md | 4 ++-- .../petstore/typescript-angular2/npm/api/PetApi.ts | 14 +++++++------- .../typescript-angular2/npm/api/StoreApi.ts | 4 ++-- .../typescript-angular2/npm/api/UserApi.ts | 4 ++-- .../petstore/typescript-angular2/npm/package.json | 2 +- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache index fe745f03b1..cff9a078f6 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache @@ -22,7 +22,7 @@ import { Configuration } from '../configurat {{/description}} @Injectable() export class {{classname}} { - protected basePath = '{{basePath}}'; + protected basePath = '{{{basePath}}}'; public defaultHeaders: Headers = new Headers(); public configuration: Configuration = new Configuration(); @@ -34,8 +34,8 @@ export class {{classname}} { this.configuration = configuration; } } - - /** + + /** * * Extends object by coping non-existing properties. * @param objA object to be extended @@ -185,4 +185,4 @@ export class {{classname}} { {{/operation}} } -{{/operations}} \ No newline at end of file +{{/operations}} diff --git a/samples/client/petstore/typescript-angular2/default/api/PetApi.ts b/samples/client/petstore/typescript-angular2/default/api/PetApi.ts index b2feacfc4e..ae42240256 100644 --- a/samples/client/petstore/typescript-angular2/default/api/PetApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/PetApi.ts @@ -39,8 +39,8 @@ export class PetApi { this.configuration = configuration; } } - - /** + + /** * * Extends object by coping non-existing properties. * @param objA object to be extended @@ -414,17 +414,17 @@ export class PetApi { 'application/xml' ]; + // authentication (api_key) required + if (this.configuration.apiKey) + { + headers.set('api_key', this.configuration.apiKey); + } // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); } - // authentication (api_key) required - if (this.configuration.apiKey) - { - headers.set('api_key', this.configuration.apiKey); - } diff --git a/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts b/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts index b3d6ea61e6..484d5e56fd 100644 --- a/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts @@ -39,8 +39,8 @@ export class StoreApi { this.configuration = configuration; } } - - /** + + /** * * Extends object by coping non-existing properties. * @param objA object to be extended diff --git a/samples/client/petstore/typescript-angular2/default/api/UserApi.ts b/samples/client/petstore/typescript-angular2/default/api/UserApi.ts index 25f38a899a..8dda0cf837 100644 --- a/samples/client/petstore/typescript-angular2/default/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/UserApi.ts @@ -39,8 +39,8 @@ export class UserApi { this.configuration = configuration; } } - - /** + + /** * * Extends object by coping non-existing properties. * @param objA object to be extended diff --git a/samples/client/petstore/typescript-angular2/npm/README.md b/samples/client/petstore/typescript-angular2/npm/README.md index bcf578d129..578fb3165a 100644 --- a/samples/client/petstore/typescript-angular2/npm/README.md +++ b/samples/client/petstore/typescript-angular2/npm/README.md @@ -1,4 +1,4 @@ -## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201611201817 +## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201612011557 ### Building @@ -19,7 +19,7 @@ navigate to the folder of your consuming project and run one of next commando's. _published:_ ``` -npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201611201817 --save +npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201612011557 --save ``` _unPublished (not recommended):_ diff --git a/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts b/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts index b2feacfc4e..ae42240256 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts @@ -39,8 +39,8 @@ export class PetApi { this.configuration = configuration; } } - - /** + + /** * * Extends object by coping non-existing properties. * @param objA object to be extended @@ -414,17 +414,17 @@ export class PetApi { 'application/xml' ]; + // authentication (api_key) required + if (this.configuration.apiKey) + { + headers.set('api_key', this.configuration.apiKey); + } // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); } - // authentication (api_key) required - if (this.configuration.apiKey) - { - headers.set('api_key', this.configuration.apiKey); - } diff --git a/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts b/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts index b3d6ea61e6..484d5e56fd 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts @@ -39,8 +39,8 @@ export class StoreApi { this.configuration = configuration; } } - - /** + + /** * * Extends object by coping non-existing properties. * @param objA object to be extended diff --git a/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts b/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts index 25f38a899a..8dda0cf837 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts @@ -39,8 +39,8 @@ export class UserApi { this.configuration = configuration; } } - - /** + + /** * * Extends object by coping non-existing properties. * @param objA object to be extended diff --git a/samples/client/petstore/typescript-angular2/npm/package.json b/samples/client/petstore/typescript-angular2/npm/package.json index 5f09b8f7a0..30cd1eb080 100644 --- a/samples/client/petstore/typescript-angular2/npm/package.json +++ b/samples/client/petstore/typescript-angular2/npm/package.json @@ -1,6 +1,6 @@ { "name": "@swagger/angular2-typescript-petstore", - "version": "0.0.1-SNAPSHOT.201611201817", + "version": "0.0.1-SNAPSHOT.201612011557", "description": "swagger client for @swagger/angular2-typescript-petstore", "author": "Swagger Codegen Contributors", "keywords": [