Skip to content

Commit bd775a9

Browse files
jimschubertwing328
authored andcommitted
[general] Remove swagger-codegen "lang" mappings (#2785)
For 4.0.0, we've removed the "lang" option. This removes any mappings from swagger-codegen "lang" to openapi-generator "generator" options.
1 parent 4b414d8 commit bd775a9

File tree

6 files changed

+7
-34
lines changed

6 files changed

+7
-34
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
4747

4848
| | Languages/Frameworks |
4949
|-|-|
50-
**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (AngularJS, Angular (2.x - 7.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs)
50+
**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (AngularJS, Angular (2.x - 7.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs)
5151
**Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed), **Erlang**, **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **Kotlin** (Spring Boot, Ktor), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra)
5252
**API documentation generators** | **HTML**, **Confluence Wiki**
5353
**Configuration files** | [**Apache2**](https://httpd.apache.org/)
@@ -596,7 +596,6 @@ OpenAPI Generator core team members are contributors who have been making signif
596596
Here is a list of template creators:
597597
* API Clients:
598598
* Ada: @stcarrez
599-
* Akka-Scala: @cchafer
600599
* Apex: @asnelling
601600
* Bash: @bkryza
602601
* C: @PowerOfCreation @zhemant [:heart:](https://www.patreon.com/zhemant)
@@ -642,6 +641,7 @@ Here is a list of template creators:
642641
* Rust: @farcaller
643642
* Rust (rust-server): @metaswitch
644643
* Scala (scalaz & http4s): @tbrown1979
644+
* Scala (Akka): @cchafer
645645
* Swift: @tkqubo
646646
* Swift 3: @hexelon
647647
* Swift 4: @ehyche

bin/openapi3/scala-akka-petstore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
ags="generate --artifact-id "scala-akka-petstore-client" -t modules/openapi-generator/src/main/resources/scala-akka-client -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g akka-scala -o samples/client/petstore/scala-akka $@"
30+
ags="generate --artifact-id "scala-akka-petstore-client" -t modules/openapi-generator/src/main/resources/scala-akka-client -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-akka -o samples/client/petstore/scala-akka $@"
3131

3232
java $JAVA_OPTS -jar $executable $ags

bin/openapi3/scala-httpclient-petstore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
ags="generate -t modules/openapi-generator/src/main/resources/scala-httpclient -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala -o samples/client/petstore/scala-httpclient $@"
30+
ags="generate -t modules/openapi-generator/src/main/resources/scala-httpclient -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-httpclient-deprecated -o samples/client/petstore/scala-httpclient $@"
3131

3232
java $JAVA_OPTS -jar $executable $ags

modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,6 @@ public class CodegenConfigurator implements Serializable {
5858

5959
public static final Logger LOGGER = LoggerFactory.getLogger(CodegenConfigurator.class);
6060

61-
private static Map<String, String> nameMigrationMap = new HashMap<>();
62-
63-
static {
64-
nameMigrationMap.put("akka-scala", new ScalaAkkaClientCodegen().getName());
65-
nameMigrationMap.put("scala", new ScalaHttpClientCodegen().getName());
66-
nameMigrationMap.put("jaxrs", new JavaJerseyServerCodegen().getName());
67-
nameMigrationMap.put("qt5cpp", new CppQt5ClientCodegen().getName());
68-
nameMigrationMap.put("cpprest", new CppRestSdkClientCodegen().getName());
69-
nameMigrationMap.put("tizen", new CppTizenClientCodegen().getName());
70-
nameMigrationMap.put("sinatra", new RubySinatraServerCodegen().getName());
71-
nameMigrationMap.put("swift", new SwiftClientCodegen().getName());
72-
nameMigrationMap.put("lumen", new PhpLumenServerCodegen().getName());
73-
nameMigrationMap.put("slim", new PhpSlimServerCodegen().getName());
74-
nameMigrationMap.put("ze-ph", new PhpZendExpressivePathHandlerServerCodegen().getName());
75-
nameMigrationMap.put("nancyfx", new CSharpNancyFXServerCodegen().getName());
76-
}
77-
7861
private String generatorName;
7962
private String inputSpec;
8063
private String outputDir;
@@ -120,8 +103,6 @@ public CodegenConfigurator() {
120103
this.setOutputDir(".");
121104
}
122105

123-
// TODO: When setLang is removed, please remove nameMigrationMap and its usage(s).
124-
125106
/**
126107
* Set the "language". This has drifted away from language-only to include framework and
127108
* hyphenated generator types as well as language.
@@ -150,15 +131,7 @@ public CodegenConfigurator() {
150131
* @return The fluent instance of {@link CodegenConfigurator}
151132
*/
152133
public CodegenConfigurator setGeneratorName(final String generatorName) {
153-
if (nameMigrationMap.containsKey(generatorName)) {
154-
String newValue = nameMigrationMap.get(generatorName);
155-
LOGGER.warn(String.format(Locale.ROOT,
156-
"The name '%s' is a deprecated. Please update to the new name of '%s'.",
157-
generatorName, newValue));
158-
this.generatorName = newValue;
159-
} else {
160-
this.generatorName = generatorName;
161-
}
134+
this.generatorName = generatorName;
162135
return this;
163136
}
164137

modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlimServerOptionsProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class PhpSlimServerOptionsProvider implements OptionsProvider {
3838

3939
@Override
4040
public String getLanguage() {
41-
return "slim";
41+
return "php-slim";
4242
}
4343

4444
@Override

modules/openapi-generator/src/test/resources/integrationtests/scala/client/required-attributes.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ declare curdir=$(cd $(dirname "${BASH_SOURCE}") && pwd)
1111
declare clijar=${SWAGGER_CODEGEN_CLI_JAR:-$(cd $curdir && cd ../../../../../../../swagger-codegen-cli/target/ && echo $PWD)/swagger-codegen-cli.jar}
1212

1313
exec \java ${opts} -jar ${clijar} generate \
14-
-i ${prefix}-spec.json -g scala \
14+
-i ${prefix}-spec.json -g scala-httpclient-deprecated \
1515
-o ${prefix}-expected;

0 commit comments

Comments
 (0)