Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/samples-typescript-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths:
- samples/client/others/typescript-angular/**
- samples/client/others/typescript-angular-v20/**
- samples/client/others/typescript-angular-v21/**
# comment out angular released before Nov 2023
#- samples/client/petstore/typescript-angular-v12-provided-in-root/**
#- samples/client/petstore/typescript-angular-v13-provided-in-root/**
Expand All @@ -15,6 +16,7 @@ on:
- samples/client/petstore/typescript-angular-v18-provided-in-root/**
- samples/client/petstore/typescript-angular-v19-provided-in-root/**
- samples/client/petstore/typescript-angular-v20-provided-in-root/**
- samples/client/petstore/typescript-angular-v21-provided-in-root/**
- samples/openapi3/client/petstore/typescript/builds/default/**
# comment out due to build failure
#- samples/openapi3/client/petstore/typescript/tests/default/**
Expand Down Expand Up @@ -45,6 +47,7 @@ on:
paths:
- samples/client/others/typescript-angular/**
- samples/client/others/typescript-angular-v20/**
- samples/client/others/typescript-angular-v21/**
#- samples/client/petstore/typescript-angular-v12-provided-in-root/**
#- samples/client/petstore/typescript-angular-v13-provided-in-root/**
#- samples/client/petstore/typescript-angular-v14-provided-in-root/**
Expand All @@ -54,6 +57,7 @@ on:
- samples/client/petstore/typescript-angular-v18-provided-in-root/**
- samples/client/petstore/typescript-angular-v19-provided-in-root/**
- samples/client/petstore/typescript-angular-v20-provided-in-root/**
- samples/client/petstore/typescript-angular-v21-provided-in-root/**
- samples/openapi3/client/petstore/typescript/builds/default/**
#- samples/openapi3/client/petstore/typescript/tests/default/**
- samples/openapi3/client/petstore/typescript/builds/jquery/**
Expand Down Expand Up @@ -95,6 +99,7 @@ jobs:
sample:
- samples/client/others/typescript-angular/
- samples/client/others/typescript-angular-v20/
- samples/client/others/typescript-angular-v21/
#- samples/client/petstore/typescript-angular-v12-provided-in-root/
#- samples/client/petstore/typescript-angular-v13-provided-in-root/
#- samples/client/petstore/typescript-angular-v14-provided-in-root/
Expand All @@ -104,6 +109,7 @@ jobs:
- samples/client/petstore/typescript-angular-v18-provided-in-root/
- samples/client/petstore/typescript-angular-v19-provided-in-root/
- samples/client/petstore/typescript-angular-v20-provided-in-root/
- samples/client/petstore/typescript-angular-v21-provided-in-root/
- samples/openapi3/client/petstore/typescript/builds/default/
#- samples/openapi3/client/petstore/typescript/tests/default/
- samples/openapi3/client/petstore/typescript/builds/jquery/
Expand Down
9 changes: 9 additions & 0 deletions bin/configs/typescript-angular-v21-provided-in-root.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
generatorName: typescript-angular
outputDir: samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
additionalProperties:
ngVersion: 21.0.0
supportsES6: true
enumNameMappings:
delivered: SHIPPED
8 changes: 8 additions & 0 deletions bin/configs/typescript-angular-v21.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
generatorName: typescript-angular
outputDir: samples/client/petstore/typescript-angular-v21/builds/default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR

can you please create a new yaml in bin/configs based on https://github.com/OpenAPITools/openapi-generator/blob/master/bin/configs/typescript-angular-v20-provided-in-root.yaml ?

then update the workflow https://github.com/OpenAPITools/openapi-generator/blob/master/.github/workflows/samples-typescript-client.yaml with the new sample folder.

please also copy the tests from samples/client/petstore/typescript-angular-v20-provided-in-root/ into the new folder

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done !

inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
additionalProperties:
ngVersion: 21.0.0
npmName: sample-angular-21-0-0
supportsES6: true
4 changes: 2 additions & 2 deletions docs/generators/typescript-angular.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ title: Documentation for the typescript-angular Generator
| generator type | CLIENT | |
| generator language | Typescript | |
| generator default templating engine | mustache | |
| helpTxt | Generates a TypeScript Angular (9.x - 20.x) client library. | |
| helpTxt | Generates a TypeScript Angular (9.x - 21.x) client library. | |

## CONFIG OPTIONS
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.
Expand All @@ -34,7 +34,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|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|
|modelSuffix|The suffix of the generated model.| |null|
|ngPackagrVersion|The version of ng-packagr compatible with Angular (see ngVersion option).| |null|
|ngVersion|The version of Angular. (At least 9.0.0)| |20.0.0|
|ngVersion|The version of Angular. (At least 9.0.0)| |21.0.0|
|npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null|
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static enum PROVIDED_IN_LEVEL {none, root, any, platform}
public static final String NGPACKAGR_VERSION = "ngPackagrVersion";
public static final String ZONEJS_VERSION = "zonejsVersion";

protected String ngVersion = "20.0.0";
protected String ngVersion = "21.0.0";
@Getter @Setter
protected String npmRepository = null;
@Setter(AccessLevel.PRIVATE) private boolean useSingleRequestParameter = false;
Expand Down Expand Up @@ -170,7 +170,7 @@ public String getName() {

@Override
public String getHelp() {
return "Generates a TypeScript Angular (9.x - 20.x) client library.";
return "Generates a TypeScript Angular (9.x - 21.x) client library.";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# For future versions...
# Get typescript and rxjs version here: https://angular.dev/reference/versions
# Get zone.js version here: https://github.com/angular/angular/blob/main/packages/core/package.json
21.0.0:
tsVersion: '>=5.9.0 <6.0.0'
rxjsVersion: 7.4.0
ngPackagrVersion: 21.0.0
zonejsVersion: 0.15.0
20.0.0:
tsVersion: '>=5.8.0 <5.9.0'
rxjsVersion: 7.4.0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "tests",
"projects": {
"test-default": {
"root": "tests/default",
"sourceRoot": "tests/default/src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"aot": true,
"outputPath": {
"base": "tests/default/dist"
},
"index": "tests/default/src/index.html",
"polyfills": [
"tests/default/src/polyfills.ts"
],
"tsConfig": "tests/default/src/tsconfig.app.json",
"assets": [
"tests/default/src/favicon.ico",
"tests/default/src/assets"
],
"styles": [
"tests/default/src/styles.css"
],
"scripts": [],
"browser": "tests/default/src/main.ts"
},
"configurations": {
"production": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"fileReplacements": [
{
"replace": "tests/default/src/environments/environment.ts",
"with": "tests/default/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": true,
"extractLicenses": true
},
"development": {}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
},
"configurations": {
"production": {
"browserTarget": "test-default:build:production"
},
"development": {
"browserTarget": "test-default:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "test-default:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "tests/default/src/test.ts",
"polyfills": "tests/default/src/polyfills.ts",
"tsConfig": "tests/default/src/tsconfig.spec.json",
"karmaConfig": "tests/default/src/karma.conf.js",
"styles": [
"tests/default/src/styles.css"
],
"scripts": [],
"assets": [
"tests/default/src/favicon.ico",
"tests/default/src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tests/default/src/tsconfig.app.json",
"tests/default/src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"cli": {
"analytics": false
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
wwwroot/*.js
node_modules
typings
dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.gitignore
README.md
api.base.service.ts
api.module.ts
api/api.ts
api/pet.service.ts
api/store.service.ts
api/user.service.ts
configuration.ts
encoder.ts
git_push.sh
index.ts
model/apiResponse.ts
model/category.ts
model/models.ts
model/order.ts
model/pet.ts
model/tag.ts
model/user.ts
param.ts
provide-api.ts
query.params.ts
variables.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.19.0-SNAPSHOT
Loading