forked from loafle/openapi-generator-original
updating versions of package.json + ignoring build files + adding basePath to ConfigurationObject and giving de ConfigurationObject an easy constructor
This commit is contained in:
parent
68bda09cd8
commit
24c23d748c
@ -35,6 +35,7 @@ export class {{classname}} {
|
|||||||
}
|
}
|
||||||
if (configuration) {
|
if (configuration) {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
|
this.basePath = basePath || configuration.basePath || this.basePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -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}}
|
||||||
|
@ -1,27 +1,28 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"suppressImplicitAnyIndexErrors": true,
|
"suppressImplicitAnyIndexErrors": true,
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"removeComments": true,
|
"removeComments": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"noLib": false,
|
"noLib": false,
|
||||||
"declaration": true
|
"declaration": true
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"typings/main.d.ts",
|
"typings/main.d.ts",
|
||||||
"typings/main",
|
"typings/main",
|
||||||
"lib"
|
"lib",
|
||||||
],
|
"dist"
|
||||||
"filesGlob": [
|
],
|
||||||
"./model/*.ts",
|
"filesGlob": [
|
||||||
"./api/*.ts",
|
"./model/*.ts",
|
||||||
"typings/browser.d.ts"
|
"./api/*.ts",
|
||||||
]
|
"typings/browser.d.ts"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@ -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();
|
||||||
|
@ -50,6 +50,7 @@ export class UserService {
|
|||||||
}
|
}
|
||||||
if (configuration) {
|
if (configuration) {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
|
this.basePath = basePath || configuration.basePath || this.basePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,27 +1,28 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"suppressImplicitAnyIndexErrors": true,
|
"suppressImplicitAnyIndexErrors": true,
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"removeComments": true,
|
"removeComments": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"noLib": false,
|
"noLib": false,
|
||||||
"declaration": true
|
"declaration": true
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"typings/main.d.ts",
|
"typings/main.d.ts",
|
||||||
"typings/main",
|
"typings/main",
|
||||||
"lib"
|
"lib",
|
||||||
],
|
"dist"
|
||||||
"filesGlob": [
|
],
|
||||||
"./model/*.ts",
|
"filesGlob": [
|
||||||
"./api/*.ts",
|
"./model/*.ts",
|
||||||
"typings/browser.d.ts"
|
"./api/*.ts",
|
||||||
]
|
"typings/browser.d.ts"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@ export class ProjectService {
|
|||||||
}
|
}
|
||||||
if (configuration) {
|
if (configuration) {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
|
this.basePath = basePath || configuration.basePath || this.basePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,27 +1,28 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"suppressImplicitAnyIndexErrors": true,
|
"suppressImplicitAnyIndexErrors": true,
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"removeComments": true,
|
"removeComments": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"noLib": false,
|
"noLib": false,
|
||||||
"declaration": true
|
"declaration": true
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"typings/main.d.ts",
|
"typings/main.d.ts",
|
||||||
"typings/main",
|
"typings/main",
|
||||||
"lib"
|
"lib",
|
||||||
],
|
"dist"
|
||||||
"filesGlob": [
|
],
|
||||||
"./model/*.ts",
|
"filesGlob": [
|
||||||
"./api/*.ts",
|
"./model/*.ts",
|
||||||
"typings/browser.d.ts"
|
"./api/*.ts",
|
||||||
]
|
"typings/browser.d.ts"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
if (configuration) {
|
if (configuration) {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
|
this.basePath = basePath || configuration.basePath || this.basePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ export class StoreService {
|
|||||||
}
|
}
|
||||||
if (configuration) {
|
if (configuration) {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
|
this.basePath = basePath || configuration.basePath || this.basePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ export class UserService {
|
|||||||
}
|
}
|
||||||
if (configuration) {
|
if (configuration) {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
|
this.basePath = basePath || configuration.basePath || this.basePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,27 +1,28 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"suppressImplicitAnyIndexErrors": true,
|
"suppressImplicitAnyIndexErrors": true,
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"removeComments": true,
|
"removeComments": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"noLib": false,
|
"noLib": false,
|
||||||
"declaration": true
|
"declaration": true
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"typings/main.d.ts",
|
"typings/main.d.ts",
|
||||||
"typings/main",
|
"typings/main",
|
||||||
"lib"
|
"lib",
|
||||||
],
|
"dist"
|
||||||
"filesGlob": [
|
],
|
||||||
"./model/*.ts",
|
"filesGlob": [
|
||||||
"./api/*.ts",
|
"./model/*.ts",
|
||||||
"typings/browser.d.ts"
|
"./api/*.ts",
|
||||||
]
|
"typings/browser.d.ts"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user