updating versions of package.json + ignoring build files + adding basePath to ConfigurationObject and giving de ConfigurationObject an easy constructor

This commit is contained in:
Kristof Vrolijkx 2016-11-14 12:26:38 +01:00 committed by wing328
parent 68bda09cd8
commit 24c23d748c
19 changed files with 219 additions and 137 deletions

View File

@ -35,6 +35,7 @@ export class {{classname}} {
} }
if (configuration) { if (configuration) {
this.configuration = configuration; this.configuration = configuration;
this.basePath = basePath || configuration.basePath || this.basePath;
} }
} }

View File

@ -1,6 +1,24 @@
export interface ConfigurationParameters {
apiKey?: string;
username?: string;
password?: string;
accessToken?: string;
basePath?: string;
}
export class Configuration { export class Configuration {
apiKey: string; apiKey: string;
username: string; username: string;
password: string; password: string;
accessToken: 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;
}
} }

View File

@ -20,7 +20,7 @@
"@angular/compiler": "^2.0.0", "@angular/compiler": "^2.0.0",
"core-js": "^2.4.0", "core-js": "^2.4.0",
"reflect-metadata": "^0.1.3", "reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6", "rxjs": "5.0.0-beta.12",
"zone.js": "^0.6.17" "zone.js": "^0.6.17"
}, },
"devDependencies": { "devDependencies": {
@ -31,9 +31,9 @@
"@angular/platform-browser": "^2.0.0", "@angular/platform-browser": "^2.0.0",
"core-js": "^2.4.0", "core-js": "^2.4.0",
"reflect-metadata": "^0.1.3", "reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6", "rxjs": "5.0.0-beta.12",
"zone.js": "^0.6.17", "zone.js": "^0.6.17",
"typescript": "^1.8.10", "typescript": "^2.0.0",
"typings": "^1.3.2" "typings": "^1.3.2"
}{{#npmRepository}},{{/npmRepository}} }{{#npmRepository}},{{/npmRepository}}
{{#npmRepository}} {{#npmRepository}}

View File

@ -17,7 +17,8 @@
"node_modules", "node_modules",
"typings/main.d.ts", "typings/main.d.ts",
"typings/main", "typings/main",
"lib" "lib",
"dist"
], ],
"filesGlob": [ "filesGlob": [
"./model/*.ts", "./model/*.ts",

View File

@ -1,17 +1,17 @@
package io.swagger.codegen; package io.swagger.codegen;
import org.testng.annotations.Test; import static io.swagger.codegen.testutils.AssertFile.assertPathEqualsRecursively;
import org.testng.reporters.Files;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;
import org.testng.annotations.Test;
import org.testng.reporters.Files;
import io.swagger.codegen.testutils.IntegrationTestPathsConfig; import io.swagger.codegen.testutils.IntegrationTestPathsConfig;
import io.swagger.models.Swagger; import io.swagger.models.Swagger;
import io.swagger.parser.SwaggerParser; import io.swagger.parser.SwaggerParser;
import static io.swagger.codegen.testutils.AssertFile.assertPathEqualsRecursively;
public abstract class AbstractIntegrationTest { public abstract class AbstractIntegrationTest {
protected abstract IntegrationTestPathsConfig getIntegrationTestPathsConfig(); protected abstract IntegrationTestPathsConfig getIntegrationTestPathsConfig();
@ -21,7 +21,7 @@ public abstract class AbstractIntegrationTest {
protected abstract Map<String, String> configProperties(); protected abstract Map<String, String> configProperties();
// @wing328: ignore for the time being until we fix the error with the integration test // @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 { public void generatesCorrectDirectoryStructure() throws IOException {
DefaultGenerator codeGen = new DefaultGenerator(); DefaultGenerator codeGen = new DefaultGenerator();
IntegrationTestPathsConfig integrationTestPathsConfig = getIntegrationTestPathsConfig(); IntegrationTestPathsConfig integrationTestPathsConfig = getIntegrationTestPathsConfig();

View File

@ -50,6 +50,7 @@ export class UserService {
} }
if (configuration) { if (configuration) {
this.configuration = configuration; this.configuration = configuration;
this.basePath = basePath || configuration.basePath || this.basePath;
} }
} }

View File

@ -1,6 +1,24 @@
export interface ConfigurationParameters {
apiKey?: string;
username?: string;
password?: string;
accessToken?: string;
basePath?: string;
}
export class Configuration { export class Configuration {
apiKey: string; apiKey: string;
username: string; username: string;
password: string; password: string;
accessToken: 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;
}
} }

View File

@ -20,7 +20,7 @@
"@angular/compiler": "^2.0.0", "@angular/compiler": "^2.0.0",
"core-js": "^2.4.0", "core-js": "^2.4.0",
"reflect-metadata": "^0.1.3", "reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6", "rxjs": "5.0.0-beta.12",
"zone.js": "^0.6.17" "zone.js": "^0.6.17"
}, },
"devDependencies": { "devDependencies": {
@ -31,9 +31,9 @@
"@angular/platform-browser": "^2.0.0", "@angular/platform-browser": "^2.0.0",
"core-js": "^2.4.0", "core-js": "^2.4.0",
"reflect-metadata": "^0.1.3", "reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6", "rxjs": "5.0.0-beta.12",
"zone.js": "^0.6.17", "zone.js": "^0.6.17",
"typescript": "^1.8.10", "typescript": "^2.0.0",
"typings": "^1.3.2" "typings": "^1.3.2"
} }
} }

View File

@ -17,7 +17,8 @@
"node_modules", "node_modules",
"typings/main.d.ts", "typings/main.d.ts",
"typings/main", "typings/main",
"lib" "lib",
"dist"
], ],
"filesGlob": [ "filesGlob": [
"./model/*.ts", "./model/*.ts",

View File

@ -51,6 +51,7 @@ export class ProjectService {
} }
if (configuration) { if (configuration) {
this.configuration = configuration; this.configuration = configuration;
this.basePath = basePath || configuration.basePath || this.basePath;
} }
} }

View File

@ -1,6 +1,24 @@
export interface ConfigurationParameters {
apiKey?: string;
username?: string;
password?: string;
accessToken?: string;
basePath?: string;
}
export class Configuration { export class Configuration {
apiKey: string; apiKey: string;
username: string; username: string;
password: string; password: string;
accessToken: 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;
}
} }

View File

@ -20,7 +20,7 @@
"@angular/compiler": "^2.0.0", "@angular/compiler": "^2.0.0",
"core-js": "^2.4.0", "core-js": "^2.4.0",
"reflect-metadata": "^0.1.3", "reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6", "rxjs": "5.0.0-beta.12",
"zone.js": "^0.6.17" "zone.js": "^0.6.17"
}, },
"devDependencies": { "devDependencies": {
@ -31,9 +31,9 @@
"@angular/platform-browser": "^2.0.0", "@angular/platform-browser": "^2.0.0",
"core-js": "^2.4.0", "core-js": "^2.4.0",
"reflect-metadata": "^0.1.3", "reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6", "rxjs": "5.0.0-beta.12",
"zone.js": "^0.6.17", "zone.js": "^0.6.17",
"typescript": "^1.8.10", "typescript": "^2.0.0",
"typings": "^1.3.2" "typings": "^1.3.2"
} }
} }

View File

@ -17,7 +17,8 @@
"node_modules", "node_modules",
"typings/main.d.ts", "typings/main.d.ts",
"typings/main", "typings/main",
"lib" "lib",
"dist"
], ],
"filesGlob": [ "filesGlob": [
"./model/*.ts", "./model/*.ts",

View File

@ -51,6 +51,7 @@ export class PetService {
} }
if (configuration) { if (configuration) {
this.configuration = configuration; this.configuration = configuration;
this.basePath = basePath || configuration.basePath || this.basePath;
} }
} }

View File

@ -50,6 +50,7 @@ export class StoreService {
} }
if (configuration) { if (configuration) {
this.configuration = configuration; this.configuration = configuration;
this.basePath = basePath || configuration.basePath || this.basePath;
} }
} }

View File

@ -50,6 +50,7 @@ export class UserService {
} }
if (configuration) { if (configuration) {
this.configuration = configuration; this.configuration = configuration;
this.basePath = basePath || configuration.basePath || this.basePath;
} }
} }

View File

@ -1,6 +1,24 @@
export interface ConfigurationParameters {
apiKey?: string;
username?: string;
password?: string;
accessToken?: string;
basePath?: string;
}
export class Configuration { export class Configuration {
apiKey: string; apiKey: string;
username: string; username: string;
password: string; password: string;
accessToken: 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;
}
} }

View File

@ -20,7 +20,7 @@
"@angular/compiler": "^2.0.0", "@angular/compiler": "^2.0.0",
"core-js": "^2.4.0", "core-js": "^2.4.0",
"reflect-metadata": "^0.1.3", "reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6", "rxjs": "5.0.0-beta.12",
"zone.js": "^0.6.17" "zone.js": "^0.6.17"
}, },
"devDependencies": { "devDependencies": {
@ -31,9 +31,9 @@
"@angular/platform-browser": "^2.0.0", "@angular/platform-browser": "^2.0.0",
"core-js": "^2.4.0", "core-js": "^2.4.0",
"reflect-metadata": "^0.1.3", "reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6", "rxjs": "5.0.0-beta.12",
"zone.js": "^0.6.17", "zone.js": "^0.6.17",
"typescript": "^1.8.10", "typescript": "^2.0.0",
"typings": "^1.3.2" "typings": "^1.3.2"
} }
} }

View File

@ -17,7 +17,8 @@
"node_modules", "node_modules",
"typings/main.d.ts", "typings/main.d.ts",
"typings/main", "typings/main",
"lib" "lib",
"dist"
], ],
"filesGlob": [ "filesGlob": [
"./model/*.ts", "./model/*.ts",