Skip to content

Commit f197944

Browse files
authored
Delete --lang option (#1592)
* Delete --lang option * Fix -l * Fix -l flag (windows) * Add migration guide * Change to -g * Remove lang option * Change to -g
1 parent 7e3e9db commit f197944

15 files changed

+26
-35
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ SYNOPSIS
425425
[--import-mappings <import mappings>...]
426426
[--instantiation-types <instantiation types>...]
427427
[--invoker-package <invoker package>]
428-
[(-l <language> | --lang <language>)]
429428
[--language-specific-primitives <language specific primitives>...]
430429
[--library <library>] [--log-to-stderr]
431430
[--model-name-prefix <model name prefix>]

bin/dart-jaguar-petstore.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ fi
2828
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
2929

3030
# Generate client
31-
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart-jaguar -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart-jaguar -o samples/client/petstore/dart-jaguar/openapi -DhideGenerationTimestamp=true -DpubName=openapi"
31+
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart-jaguar -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart-jaguar -o samples/client/petstore/dart-jaguar/openapi -DhideGenerationTimestamp=true -DpubName=openapi"
3232
java $JAVA_OPTS -jar $executable $ags
3333

3434
# Generate non-browserClient and put it to the flutter sample app
35-
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart-jaguar -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart-jaguar -o samples/client/petstore/dart-jaguar/flutter_petstore/openapi -DhideGenerationTimestamp=true -DpubName=openapi"
35+
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart-jaguar -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart-jaguar -o samples/client/petstore/dart-jaguar/flutter_petstore/openapi -DhideGenerationTimestamp=true -DpubName=openapi"
3636
java $JAVA_OPTS -jar $executable $ags
3737

3838
# There is a proposal to allow importing different libraries depending on the environment:

bin/security/perl-petstore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fi
2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
3030
# complex module name used for testing
31-
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -l perl -o samples/client/petstore-security-test/perl $@"
31+
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g perl -o samples/client/petstore-security-test/perl $@"
3232

3333
java $JAVA_OPTS -jar $executable $ags
3434

bin/windows/dart-client-petstore.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ If Not Exist %executable% (
55
)
66

77
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
8-
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l dart-jaguar -o samples\client\petstore\dart-jaguar\swagger -DhideGenerationTimestamp=true -DbrowserClient=false
8+
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -g dart-jaguar -o samples\client\petstore\dart-jaguar\swagger -DhideGenerationTimestamp=true -DbrowserClient=false
99
java %JAVA_OPTS% -jar %executable% %ags%
1010

11-
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l dart-jaguar -o samples\client\petstore\dart-jaguar\flutter_petstore\swagger -DhideGenerationTimestamp=true
11+
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -g dart-jaguar -o samples\client\petstore\dart-jaguar\flutter_petstore\swagger -DhideGenerationTimestamp=true
1212
java %JAVA_OPTS% -jar %executable% %ags%

bin/windows/typescript-angular-v6-not-provided-in-root-with-npm.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ If Not Exist %executable% (
55
)
66

77
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
8-
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -c bin\typescript-angular-v6-petstore-not-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v6-not-provided-in-root\builds\with-npm -D providedInRoot=false --additional-properties ngVersion=6.0.0
8+
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -c bin\typescript-angular-v6-petstore-not-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v6-not-provided-in-root\builds\with-npm -D providedInRoot=false --additional-properties ngVersion=6.0.0
99

1010
java %JAVA_OPTS% -jar %executable% %ags%

bin/windows/typescript-angular-v6-not-provided-in-root.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ If Not Exist %executable% (
55
)
66

77
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
8-
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -o samples\client\petstore\typescript-angular-v6-not-provided-in-root\builds\default -D providedInRoot=false --additional-properties ngVersion=6.0.0
8+
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -o samples\client\petstore\typescript-angular-v6-not-provided-in-root\builds\default -D providedInRoot=false --additional-properties ngVersion=6.0.0
99

1010
java %JAVA_OPTS% -jar %executable% %ags%

bin/windows/typescript-angular-v6-provided-in-root-with-npm.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ If Not Exist %executable% (
44
mvn clean package
55
)
66

7-
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -c bin/typescript-angular-v6-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\with-npm --additional-properties ngVersion=6.0.0
7+
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -c bin/typescript-angular-v6-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\with-npm --additional-properties ngVersion=6.0.0
88

99
java %JAVA_OPTS% -jar %executable% %ags%

bin/windows/typescript-angular-v6-provided-in-root.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ If Not Exist %executable% (
44
mvn clean package
55
)
66

7-
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\default --additional-properties ngVersion=6.0.0
7+
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\default --additional-properties ngVersion=6.0.0
88

99
java %JAVA_OPTS% -jar %executable% %ags%

bin/windows/typescript-angular-v7-not-provided-in-root-with-npm.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ If Not Exist %executable% (
55
)
66

77
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
8-
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -c bin\typescript-angular-v7-petstore-not-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v7-not-provided-in-root\builds\with-npm -D providedInRoot=false --additional-properties ngVersion=7.0.0
8+
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -c bin\typescript-angular-v7-petstore-not-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v7-not-provided-in-root\builds\with-npm -D providedInRoot=false --additional-properties ngVersion=7.0.0
99

1010
java %JAVA_OPTS% -jar %executable% %ags%

bin/windows/typescript-angular-v7-not-provided-in-root.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ If Not Exist %executable% (
55
)
66

77
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
8-
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -o samples\client\petstore\typescript-angular-v7-not-provided-in-root\builds\default -D providedInRoot=false --additional-properties ngVersion=7.0.0
8+
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -o samples\client\petstore\typescript-angular-v7-not-provided-in-root\builds\default -D providedInRoot=false --additional-properties ngVersion=7.0.0
99

1010
java %JAVA_OPTS% -jar %executable% %ags%

bin/windows/typescript-angular-v7-provided-in-root-with-npm.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ If Not Exist %executable% (
44
mvn clean package
55
)
66

7-
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -c bin/typescript-angular-v7-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v7-provided-in-root\builds\with-npm --additional-properties ngVersion=7.0.0
7+
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -c bin/typescript-angular-v7-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v7-provided-in-root\builds\with-npm --additional-properties ngVersion=7.0.0
88

99
java %JAVA_OPTS% -jar %executable% %ags%

bin/windows/typescript-angular-v7-provided-in-root.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ If Not Exist %executable% (
44
mvn clean package
55
)
66

7-
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -o samples\client\petstore\typescript-angular-v7-provided-in-root\builds\default --additional-properties ngVersion=7.0.0
7+
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -o samples\client\petstore\typescript-angular-v7-provided-in-root\builds\default --additional-properties ngVersion=7.0.0
88

99
java %JAVA_OPTS% -jar %executable% %ags%

docs/migration-guide.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ Another approach to find breaking changes is to look at issue and pull requests
1111
* link:https://github.com/OpenAPITools/openapi-generator/labels/Breaking%20change%20%28with%20fallback%29[Breaking change (with fallback)]
1212
* link:https://github.com/OpenAPITools/openapi-generator/labels/Breaking%20change%20%28without%20fallback%29[Breaking change (without fallback)]
1313
14+
=== From 3.x to 4.0.0
15+
16+
Version `4.0.0` is a major release, which contains some breaking changes without fallback.
17+
18+
==== The `-l` (`--lang`) option has been deleted
19+
20+
The option is replaced with `-g` (`--generator-name`).
21+
22+
* `-g` allows the same values as `-l`
23+
* See `langs` command for the list of generator name
24+
1425
=== From 3.1.x to 3.2.0
1526

1627
Version `3.2.0` is a minor version of OpenAPI-Generator, in comparison to `3.1.x` it contains some breaking changes, but with the possibility to fallback to the old behavior.

modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ public class ConfigHelp implements Runnable {
3737

3838
private static final Logger LOGGER = LoggerFactory.getLogger(Generate.class);
3939

40-
@Option(name = {"-l", "--lang"}, title = "language",
41-
description = "language to get config help for")
42-
private String lang;
43-
4440
@Option(name = {"-g", "--generator-name"}, title = "generator name",
4541
description = "generator to get config help for")
4642
private String generatorName;
@@ -57,16 +53,9 @@ public class ConfigHelp implements Runnable {
5753

5854
@Override
5955
public void run() {
60-
61-
// TODO: After 3.0.0 release (maybe for 3.1.0): Fully deprecate lang.
6256
if (isEmpty(generatorName)) {
63-
if (isNotEmpty(lang)) {
64-
LOGGER.warn("The '--lang' and '-l' are deprecated and may reference language names only in the next major release (4.0). Please use --generator-name /-g instead.");
65-
generatorName = lang;
66-
} else {
67-
System.err.println("[error] A generator name (--generator-name / -g) is required.");
68-
System.exit(1);
69-
}
57+
System.err.println("[error] A generator name (--generator-name / -g) is required.");
58+
System.exit(1);
7059
}
7160

7261
try {

modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ public class Generate implements Runnable {
4949
@Option(name = {"-v", "--verbose"}, description = "verbose mode")
5050
private Boolean verbose;
5151

52-
@Option(name = {"-l", "--lang"}, title = "language",
53-
description = "client language to generate (maybe class name in classpath, required)")
54-
private String lang;
55-
5652
@Option(name = {"-g", "--generator-name"}, title = "generator name",
5753
description = "generator to use (see langs command for list)")
5854
private String generatorName;
@@ -255,12 +251,8 @@ public void run() {
255251
configurator.setInputSpec(spec);
256252
}
257253

258-
// TODO: After 3.0.0 release (maybe for 3.1.0): Fully deprecate lang.
259254
if (isNotEmpty(generatorName)) {
260255
configurator.setGeneratorName(generatorName);
261-
} else if (isNotEmpty(lang)) {
262-
LOGGER.warn("The '--lang' and '-l' are deprecated and may reference language names only in the next major release (4.0). Please use --generator-name /-g instead.");
263-
configurator.setGeneratorName(lang);
264256
} else {
265257
System.err.println("[error] A generator name (--generator-name / -g) is required.");
266258
System.exit(1);

0 commit comments

Comments
 (0)