Skip to content

Commit 423ba67

Browse files
thibaudsowaThibaud SOWA
andauthored
feat(typescript-angular): add support for Angular V19 (#20205)
* feat(typescript-angular): add support for Angular V19 fix #20204 * feat(typescript-angular): add options to override angular deps + refactor deps definition add tsVersion, rxjsVersion, ngPackagrVersion and zonejsVersion options to override default config if new version of Angular is available but not yet implemented in openapi-generator refactor Angular dependencies definition in separate readable yaml config file fix #20204 * feat(typescript-angular): add better angular 19 exemple for ci testing fix #20204 * feat(typescript-angular): unify tsVersion param fix #20204 --------- Co-authored-by: Thibaud SOWA <[email protected]>
1 parent cf78f10 commit 423ba67

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+18400
-114
lines changed

CI/circle_parallel.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ elif [ "$NODE_INDEX" = "3" ]; then
8080
(cd samples/client/petstore/typescript-angular-v16-provided-in-root && mvn integration-test)
8181
(cd samples/client/petstore/typescript-angular-v17-provided-in-root && mvn integration-test)
8282
(cd samples/client/petstore/typescript-angular-v18-provided-in-root && mvn integration-test)
83+
(cd samples/client/petstore/typescript-angular-v19-provided-in-root && mvn integration-test)
8384
(cd samples/openapi3/client/petstore/typescript/builds/default && mvn integration-test)
8485
(cd samples/openapi3/client/petstore/typescript/tests/default && mvn integration-test)
8586
(cd samples/openapi3/client/petstore/typescript/builds/jquery && mvn integration-test)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
8787

8888
| | Languages/Frameworks |
8989
| -------------------------------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
90-
| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient 4.x, Apache HttpClient 5.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, Spring 6 RestClient, MicroProfile Rest Client, Helidon), **Jetbrains HTTP Client**, **Julia**, **k6**, **Kotlin**, **Lua**, **N4JS**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient, pekko), **Swift** (2.x, 3.x, 4.x, 5.x, 6.x), **Typescript** (AngularJS, Angular (9.x - 18.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs), **XoJo**, **Zapier** |
90+
| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient 4.x, Apache HttpClient 5.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, Spring 6 RestClient, MicroProfile Rest Client, Helidon), **Jetbrains HTTP Client**, **Julia**, **k6**, **Kotlin**, **Lua**, **N4JS**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient, pekko), **Swift** (2.x, 3.x, 4.x, 5.x, 6.x), **Typescript** (AngularJS, Angular (9.x - 19.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs), **XoJo**, **Zapier** |
9191
| **Server stubs** | **Ada**, **C#** (ASP.NET Core, Azure Functions), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/), [Apache Camel](https://camel.apache.org/), [Helidon](https://helidon.io/)), **Julia**, **Kotlin** (Spring Boot, [Ktor](https://github.com/ktorio/ktor), [Vert.x](https://vertx.io/)), **PHP** ([Flight](https://docs.flightphp.com/), Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** ([rust-server](https://openapi-generator.tech/docs/generators/rust-server/)), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), [Cask](https://github.com/com-lihaoyi/cask), Scalatra) |
9292
| **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** |
9393
| **Configuration files** | [**Apache2**](https://httpd.apache.org/) |
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
generatorName: typescript-angular
2+
outputDir: samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
5+
additionalProperties:
6+
ngVersion: 19.0.0
7+
supportsES6: true

docs/generators/typescript-angular.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ title: Documentation for the typescript-angular Generator
1111
| generator type | CLIENT | |
1212
| generator language | Typescript | |
1313
| generator default templating engine | mustache | |
14-
| helpTxt | Generates a TypeScript Angular (9.x - 18.x) client library. | |
14+
| helpTxt | Generates a TypeScript Angular (9.x - 19.x) client library. | |
1515

1616
## CONFIG OPTIONS
1717
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
@@ -33,7 +33,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3333
|modelFileSuffix|The suffix of the file of the generated model (model&lt;suffix&gt;.ts).| |null|
3434
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original|
3535
|modelSuffix|The suffix of the generated model.| |null|
36-
|ngVersion|The version of Angular. (At least 9.0.0)| |18.0.0|
36+
|ngPackagrVersion|The version of ng-packagr compatible with Angular (see ngVersion option).| |null|
37+
|ngVersion|The version of Angular. (At least 9.0.0)| |19.0.0|
3738
|npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null|
3839
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
3940
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
@@ -42,6 +43,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
4243
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
4344
|providedIn|Use this property to provide Injectables in wanted level.|<dl><dt>**root**</dt><dd>The application-level injector in most apps.</dd><dt>**none**</dt><dd>No providedIn)</dd><dt>**any**</dt><dd>Provides a unique instance in each lazy loaded module while all eagerly loaded modules share one instance.</dd><dt>**platform**</dt><dd>A special singleton platform injector shared by all applications on the page.</dd></dl>|root|
4445
|queryParamObjectFormat|The format for query param objects: 'dot', 'json', 'key'.| |dot|
46+
|rxjsVersion|The version of RxJS compatible with Angular (see ngVersion option).| |null|
4547
|serviceFileSuffix|The suffix of the file of the generated service (service&lt;suffix&gt;.ts).| |.service|
4648
|serviceSuffix|The suffix of the generated service.| |Service|
4749
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
@@ -50,9 +52,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl
5052
|stringEnums|Generate string enums instead of objects for enum values.| |false|
5153
|supportsES6|Generate code that conforms to ES6.| |false|
5254
|taggedUnions|Use discriminators to create tagged unions instead of extending interfaces.| |false|
55+
|tsVersion|The version of typescript compatible with Angular (see ngVersion option).| |null|
5356
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false|
5457
|useSquareBracketsInArrayNames|Setting this property to true will add brackets to array attribute names, e.g. my_values[].| |false|
5558
|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false|
59+
|zoneJsVersion|The version of zone.js compatible with Angular (see ngVersion option).| |null|
5660

5761
## IMPORT MAPPING
5862

modules/openapi-generator/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,11 @@
459459
<artifactId>lombok</artifactId>
460460
<version>${lombok.version}</version>
461461
</dependency>
462+
<dependency>
463+
<groupId>org.yaml</groupId>
464+
<artifactId>snakeyaml</artifactId>
465+
<version>${snakeyaml.version}</version>
466+
</dependency>
462467
</dependencies>
463468
<repositories>
464469
<repository>

0 commit comments

Comments
 (0)