diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache index e3faca98485..775612c16a3 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache @@ -35,6 +35,7 @@ export class {{classname}} { } if (configuration) { this.configuration = configuration; + this.basePath = basePath || configuration.basePath || this.basePath; } } diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/configuration.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/configuration.mustache index 94989933b63..ec087d2b0c8 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/configuration.mustache @@ -1,6 +1,24 @@ +export interface ConfigurationParameters { + apiKey?: string; + username?: string; + password?: string; + accessToken?: string; + basePath?: string; +} + export class Configuration { - apiKey: string; - username: string; - password: string; - accessToken: string; -} \ No newline at end of file + apiKey: string; + username: string; + password: string; + accessToken: string; + basePath: string; + + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKey = configurationParameters.apiKey; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + } +} diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/package.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/package.mustache index 861c3019b5c..4b24d25e242 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/package.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/package.mustache @@ -20,7 +20,7 @@ "@angular/compiler": "^2.0.0", "core-js": "^2.4.0", "reflect-metadata": "^0.1.3", - "rxjs": "5.0.0-beta.6", + "rxjs": "5.0.0-beta.12", "zone.js": "^0.6.17" }, "devDependencies": { @@ -31,9 +31,9 @@ "@angular/platform-browser": "^2.0.0", "core-js": "^2.4.0", "reflect-metadata": "^0.1.3", - "rxjs": "5.0.0-beta.6", + "rxjs": "5.0.0-beta.12", "zone.js": "^0.6.17", - "typescript": "^1.8.10", + "typescript": "^2.0.0", "typings": "^1.3.2" }{{#npmRepository}},{{/npmRepository}} {{#npmRepository}} diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/tsconfig.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/tsconfig.mustache index 07fbdf7e1b1..e1f949692b6 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/tsconfig.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/tsconfig.mustache @@ -1,27 +1,28 @@ { - "compilerOptions": { - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "noImplicitAny": false, - "suppressImplicitAnyIndexErrors": true, - "target": "es5", - "module": "commonjs", - "moduleResolution": "node", - "removeComments": true, - "sourceMap": true, - "outDir": "./lib", - "noLib": false, - "declaration": true - }, - "exclude": [ - "node_modules", - "typings/main.d.ts", - "typings/main", - "lib" - ], - "filesGlob": [ - "./model/*.ts", - "./api/*.ts", - "typings/browser.d.ts" - ] + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitAny": false, + "suppressImplicitAnyIndexErrors": true, + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "removeComments": true, + "sourceMap": true, + "outDir": "./lib", + "noLib": false, + "declaration": true + }, + "exclude": [ + "node_modules", + "typings/main.d.ts", + "typings/main", + "lib", + "dist" + ], + "filesGlob": [ + "./model/*.ts", + "./api/*.ts", + "typings/browser.d.ts" + ] } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/AbstractIntegrationTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/AbstractIntegrationTest.java index 8aaa127c6d8..3dd4dd9bca6 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/AbstractIntegrationTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/AbstractIntegrationTest.java @@ -1,17 +1,17 @@ package io.swagger.codegen; -import org.testng.annotations.Test; -import org.testng.reporters.Files; +import static io.swagger.codegen.testutils.AssertFile.assertPathEqualsRecursively; import java.io.IOException; import java.util.Map; +import org.testng.annotations.Test; +import org.testng.reporters.Files; + import io.swagger.codegen.testutils.IntegrationTestPathsConfig; import io.swagger.models.Swagger; import io.swagger.parser.SwaggerParser; -import static io.swagger.codegen.testutils.AssertFile.assertPathEqualsRecursively; - public abstract class AbstractIntegrationTest { protected abstract IntegrationTestPathsConfig getIntegrationTestPathsConfig(); @@ -21,7 +21,7 @@ public abstract class AbstractIntegrationTest { protected abstract Map configProperties(); // @wing328: ignore for the time being until we fix the error with the integration test - @Test(enabled = false) + @Test(enabled = true) public void generatesCorrectDirectoryStructure() throws IOException { DefaultGenerator codeGen = new DefaultGenerator(); IntegrationTestPathsConfig integrationTestPathsConfig = getIntegrationTestPathsConfig(); diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/api/user.service.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/api/user.service.ts index 8ce9e917afe..3d0a08ea2f1 100644 --- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/api/user.service.ts +++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/api/user.service.ts @@ -50,6 +50,7 @@ export class UserService { } if (configuration) { this.configuration = configuration; + this.basePath = basePath || configuration.basePath || this.basePath; } } diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/configuration.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/configuration.ts index 94989933b63..ec087d2b0c8 100644 --- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/configuration.ts +++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/configuration.ts @@ -1,6 +1,24 @@ +export interface ConfigurationParameters { + apiKey?: string; + username?: string; + password?: string; + accessToken?: string; + basePath?: string; +} + export class Configuration { - apiKey: string; - username: string; - password: string; - accessToken: string; -} \ No newline at end of file + apiKey: string; + username: string; + password: string; + accessToken: string; + basePath: string; + + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKey = configurationParameters.apiKey; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + } +} diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/package.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/package.json index 41175ec19ca..2cd81b2a584 100644 --- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/package.json +++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/package.json @@ -20,7 +20,7 @@ "@angular/compiler": "^2.0.0", "core-js": "^2.4.0", "reflect-metadata": "^0.1.3", - "rxjs": "5.0.0-beta.6", + "rxjs": "5.0.0-beta.12", "zone.js": "^0.6.17" }, "devDependencies": { @@ -31,9 +31,9 @@ "@angular/platform-browser": "^2.0.0", "core-js": "^2.4.0", "reflect-metadata": "^0.1.3", - "rxjs": "5.0.0-beta.6", + "rxjs": "5.0.0-beta.12", "zone.js": "^0.6.17", - "typescript": "^1.8.10", + "typescript": "^2.0.0", "typings": "^1.3.2" } } diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/tsconfig.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/tsconfig.json index 07fbdf7e1b1..e1f949692b6 100644 --- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/tsconfig.json +++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/tsconfig.json @@ -1,27 +1,28 @@ { - "compilerOptions": { - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "noImplicitAny": false, - "suppressImplicitAnyIndexErrors": true, - "target": "es5", - "module": "commonjs", - "moduleResolution": "node", - "removeComments": true, - "sourceMap": true, - "outDir": "./lib", - "noLib": false, - "declaration": true - }, - "exclude": [ - "node_modules", - "typings/main.d.ts", - "typings/main", - "lib" - ], - "filesGlob": [ - "./model/*.ts", - "./api/*.ts", - "typings/browser.d.ts" - ] + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitAny": false, + "suppressImplicitAnyIndexErrors": true, + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "removeComments": true, + "sourceMap": true, + "outDir": "./lib", + "noLib": false, + "declaration": true + }, + "exclude": [ + "node_modules", + "typings/main.d.ts", + "typings/main", + "lib", + "dist" + ], + "filesGlob": [ + "./model/*.ts", + "./api/*.ts", + "typings/browser.d.ts" + ] } diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/api/project.service.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/api/project.service.ts index fb45db7433b..71257302a9c 100644 --- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/api/project.service.ts +++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/api/project.service.ts @@ -51,6 +51,7 @@ export class ProjectService { } if (configuration) { this.configuration = configuration; + this.basePath = basePath || configuration.basePath || this.basePath; } } diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/configuration.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/configuration.ts index 94989933b63..ec087d2b0c8 100644 --- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/configuration.ts +++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/configuration.ts @@ -1,6 +1,24 @@ +export interface ConfigurationParameters { + apiKey?: string; + username?: string; + password?: string; + accessToken?: string; + basePath?: string; +} + export class Configuration { - apiKey: string; - username: string; - password: string; - accessToken: string; -} \ No newline at end of file + apiKey: string; + username: string; + password: string; + accessToken: string; + basePath: string; + + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKey = configurationParameters.apiKey; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + } +} diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/package.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/package.json index 2a5aa332c70..5cf0e58f722 100644 --- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/package.json +++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/package.json @@ -20,7 +20,7 @@ "@angular/compiler": "^2.0.0", "core-js": "^2.4.0", "reflect-metadata": "^0.1.3", - "rxjs": "5.0.0-beta.6", + "rxjs": "5.0.0-beta.12", "zone.js": "^0.6.17" }, "devDependencies": { @@ -31,9 +31,9 @@ "@angular/platform-browser": "^2.0.0", "core-js": "^2.4.0", "reflect-metadata": "^0.1.3", - "rxjs": "5.0.0-beta.6", + "rxjs": "5.0.0-beta.12", "zone.js": "^0.6.17", - "typescript": "^1.8.10", + "typescript": "^2.0.0", "typings": "^1.3.2" } } diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/tsconfig.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/tsconfig.json index 07fbdf7e1b1..e1f949692b6 100644 --- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/tsconfig.json +++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/tsconfig.json @@ -1,27 +1,28 @@ { - "compilerOptions": { - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "noImplicitAny": false, - "suppressImplicitAnyIndexErrors": true, - "target": "es5", - "module": "commonjs", - "moduleResolution": "node", - "removeComments": true, - "sourceMap": true, - "outDir": "./lib", - "noLib": false, - "declaration": true - }, - "exclude": [ - "node_modules", - "typings/main.d.ts", - "typings/main", - "lib" - ], - "filesGlob": [ - "./model/*.ts", - "./api/*.ts", - "typings/browser.d.ts" - ] + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitAny": false, + "suppressImplicitAnyIndexErrors": true, + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "removeComments": true, + "sourceMap": true, + "outDir": "./lib", + "noLib": false, + "declaration": true + }, + "exclude": [ + "node_modules", + "typings/main.d.ts", + "typings/main", + "lib", + "dist" + ], + "filesGlob": [ + "./model/*.ts", + "./api/*.ts", + "typings/browser.d.ts" + ] } diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/pet.service.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/pet.service.ts index 611a63940bb..ebf28064219 100644 --- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/pet.service.ts +++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/pet.service.ts @@ -51,6 +51,7 @@ export class PetService { } if (configuration) { this.configuration = configuration; + this.basePath = basePath || configuration.basePath || this.basePath; } } diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/store.service.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/store.service.ts index 6288068de59..a30c27d25df 100644 --- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/store.service.ts +++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/store.service.ts @@ -50,6 +50,7 @@ export class StoreService { } if (configuration) { this.configuration = configuration; + this.basePath = basePath || configuration.basePath || this.basePath; } } diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/user.service.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/user.service.ts index 25cec2c8f5b..2246435f5a0 100644 --- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/user.service.ts +++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/user.service.ts @@ -50,6 +50,7 @@ export class UserService { } if (configuration) { this.configuration = configuration; + this.basePath = basePath || configuration.basePath || this.basePath; } } diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/configuration.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/configuration.ts index 94989933b63..ec087d2b0c8 100644 --- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/configuration.ts +++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/configuration.ts @@ -1,6 +1,24 @@ +export interface ConfigurationParameters { + apiKey?: string; + username?: string; + password?: string; + accessToken?: string; + basePath?: string; +} + export class Configuration { - apiKey: string; - username: string; - password: string; - accessToken: string; -} \ No newline at end of file + apiKey: string; + username: string; + password: string; + accessToken: string; + basePath: string; + + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKey = configurationParameters.apiKey; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + } +} diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/package.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/package.json index 2791ef6b795..67a62a97741 100644 --- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/package.json +++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/package.json @@ -20,7 +20,7 @@ "@angular/compiler": "^2.0.0", "core-js": "^2.4.0", "reflect-metadata": "^0.1.3", - "rxjs": "5.0.0-beta.6", + "rxjs": "5.0.0-beta.12", "zone.js": "^0.6.17" }, "devDependencies": { @@ -31,9 +31,9 @@ "@angular/platform-browser": "^2.0.0", "core-js": "^2.4.0", "reflect-metadata": "^0.1.3", - "rxjs": "5.0.0-beta.6", + "rxjs": "5.0.0-beta.12", "zone.js": "^0.6.17", - "typescript": "^1.8.10", + "typescript": "^2.0.0", "typings": "^1.3.2" } } diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/tsconfig.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/tsconfig.json index 07fbdf7e1b1..e1f949692b6 100644 --- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/tsconfig.json +++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/tsconfig.json @@ -1,27 +1,28 @@ { - "compilerOptions": { - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "noImplicitAny": false, - "suppressImplicitAnyIndexErrors": true, - "target": "es5", - "module": "commonjs", - "moduleResolution": "node", - "removeComments": true, - "sourceMap": true, - "outDir": "./lib", - "noLib": false, - "declaration": true - }, - "exclude": [ - "node_modules", - "typings/main.d.ts", - "typings/main", - "lib" - ], - "filesGlob": [ - "./model/*.ts", - "./api/*.ts", - "typings/browser.d.ts" - ] + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitAny": false, + "suppressImplicitAnyIndexErrors": true, + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "removeComments": true, + "sourceMap": true, + "outDir": "./lib", + "noLib": false, + "declaration": true + }, + "exclude": [ + "node_modules", + "typings/main.d.ts", + "typings/main", + "lib", + "dist" + ], + "filesGlob": [ + "./model/*.ts", + "./api/*.ts", + "typings/browser.d.ts" + ] }