From 20383fef607eb8d422faad6d47e5d53297c59a62 Mon Sep 17 00:00:00 2001 From: Kevin Brey Date: Mon, 6 Apr 2020 15:29:23 -0500 Subject: [PATCH 1/2] parse PROVIDED_IN_ROOT correctly --- .../languages/TypeScriptAngularClientCodegen.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java index 24007199db1..f52e9f79382 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java @@ -127,8 +127,16 @@ public void processOpts() { taggedUnions = Boolean.parseBoolean(additionalProperties.get(TAGGED_UNIONS).toString()); } - if (additionalProperties.containsKey(PROVIDED_IN_ROOT) && !ngVersion.atLeast("6.0.0")) { - additionalProperties.put(PROVIDED_IN_ROOT,false); + if (ngVersion.atLeast("6.0.0")) { + if (!additionalProperties.containsKey(PROVIDED_IN_ROOT)) { + additionalProperties.put(PROVIDED_IN_ROOT, true); + } else { + additionalProperties.put(PROVIDED_IN_ROOT, Boolean.parseBoolean( + additionalProperties.get(PROVIDED_IN_ROOT).toString() + )); + } + } else { + additionalProperties.put(PROVIDED_IN_ROOT, false); } additionalProperties.put(NG_VERSION, ngVersion); From e32a71f357a855fb5d57b88c43f0800ada147f19 Mon Sep 17 00:00:00 2001 From: Kevin Brey Date: Mon, 6 Apr 2020 16:03:41 -0500 Subject: [PATCH 2/2] update samples --- .../typescript-angular-v2/default/.swagger-codegen/VERSION | 2 +- .../typescript-angular-v2/npm/.swagger-codegen/VERSION | 2 +- .../with-interfaces/.swagger-codegen/VERSION | 2 +- .../typescript-angular-v4.3/npm/.swagger-codegen/VERSION | 2 +- .../with-interfaces/.swagger-codegen/VERSION | 2 +- .../typescript-angular-v4/npm/.swagger-codegen/VERSION | 2 +- .../typescript-angular-v5/npm/.swagger-codegen/VERSION | 2 +- .../with-interfaces/.swagger-codegen/VERSION | 2 +- .../typescript-angular-v6/npm/.swagger-codegen/VERSION | 2 +- .../petstore/typescript-angular-v6/npm/api/pet.service.ts | 4 +++- .../petstore/typescript-angular-v6/npm/api/store.service.ts | 4 +++- .../petstore/typescript-angular-v6/npm/api/user.service.ts | 4 +++- 12 files changed, 18 insertions(+), 12 deletions(-) diff --git a/samples/client/petstore/typescript-angular-v2/default/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v2/default/.swagger-codegen/VERSION index facc1f2079f..91fb2f83cd4 100644 --- a/samples/client/petstore/typescript-angular-v2/default/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v2/default/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.12-SNAPSHOT \ No newline at end of file +2.4.14-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v2/npm/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v2/npm/.swagger-codegen/VERSION index facc1f2079f..91fb2f83cd4 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v2/npm/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.12-SNAPSHOT \ No newline at end of file +2.4.14-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v2/with-interfaces/.swagger-codegen/VERSION index facc1f2079f..91fb2f83cd4 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.12-SNAPSHOT \ No newline at end of file +2.4.14-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen/VERSION index facc1f2079f..91fb2f83cd4 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.12-SNAPSHOT \ No newline at end of file +2.4.14-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v4.3/with-interfaces/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v4.3/with-interfaces/.swagger-codegen/VERSION index facc1f2079f..91fb2f83cd4 100644 --- a/samples/client/petstore/typescript-angular-v4.3/with-interfaces/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v4.3/with-interfaces/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.12-SNAPSHOT \ No newline at end of file +2.4.14-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v4/npm/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v4/npm/.swagger-codegen/VERSION index facc1f2079f..91fb2f83cd4 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v4/npm/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.12-SNAPSHOT \ No newline at end of file +2.4.14-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v5/npm/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v5/npm/.swagger-codegen/VERSION index facc1f2079f..91fb2f83cd4 100644 --- a/samples/client/petstore/typescript-angular-v5/npm/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v5/npm/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.12-SNAPSHOT \ No newline at end of file +2.4.14-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v5/with-interfaces/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v5/with-interfaces/.swagger-codegen/VERSION index facc1f2079f..91fb2f83cd4 100644 --- a/samples/client/petstore/typescript-angular-v5/with-interfaces/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v5/with-interfaces/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.12-SNAPSHOT \ No newline at end of file +2.4.14-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6/npm/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v6/npm/.swagger-codegen/VERSION index facc1f2079f..91fb2f83cd4 100644 --- a/samples/client/petstore/typescript-angular-v6/npm/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v6/npm/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.12-SNAPSHOT \ No newline at end of file +2.4.14-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6/npm/api/pet.service.ts index a89bfff351c..1e4b18e419e 100644 --- a/samples/client/petstore/typescript-angular-v6/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6/npm/api/pet.service.ts @@ -25,7 +25,9 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; -@Injectable() +@Injectable({ + providedIn: 'root' +}) export class PetService { protected basePath = 'http://petstore.swagger.io/v2'; diff --git a/samples/client/petstore/typescript-angular-v6/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6/npm/api/store.service.ts index e7141399dc9..320e9a696a7 100644 --- a/samples/client/petstore/typescript-angular-v6/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6/npm/api/store.service.ts @@ -24,7 +24,9 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; -@Injectable() +@Injectable({ + providedIn: 'root' +}) export class StoreService { protected basePath = 'http://petstore.swagger.io/v2'; diff --git a/samples/client/petstore/typescript-angular-v6/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6/npm/api/user.service.ts index f80c6132ef8..fd173396cc4 100644 --- a/samples/client/petstore/typescript-angular-v6/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6/npm/api/user.service.ts @@ -24,7 +24,9 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; -@Injectable() +@Injectable({ + providedIn: 'root' +}) export class UserService { protected basePath = 'http://petstore.swagger.io/v2';