[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.
This commit is contained in:
Jim Schubert 2019-05-02 05:53:41 -04:00 committed by William Cheng
parent 4b414d81d4
commit bd775a992c
6 changed files with 7 additions and 34 deletions

View File

@ -47,7 +47,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
| | Languages/Frameworks |
|-|-|
**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)
**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)
**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)
**API documentation generators** | **HTML**, **Confluence Wiki**
**Configuration files** | [**Apache2**](https://httpd.apache.org/)
@ -596,7 +596,6 @@ OpenAPI Generator core team members are contributors who have been making signif
Here is a list of template creators:
* API Clients:
* Ada: @stcarrez
* Akka-Scala: @cchafer
* Apex: @asnelling
* Bash: @bkryza
* C: @PowerOfCreation @zhemant [:heart:](https://www.patreon.com/zhemant)
@ -642,6 +641,7 @@ Here is a list of template creators:
* Rust: @farcaller
* Rust (rust-server): @metaswitch
* Scala (scalaz & http4s): @tbrown1979
* Scala (Akka): @cchafer
* Swift: @tkqubo
* Swift 3: @hexelon
* Swift 4: @ehyche

View File

@ -27,6 +27,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
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 $@"
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 $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -27,6 +27,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
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 $@"
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 $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -58,23 +58,6 @@ public class CodegenConfigurator implements Serializable {
public static final Logger LOGGER = LoggerFactory.getLogger(CodegenConfigurator.class);
private static Map<String, String> nameMigrationMap = new HashMap<>();
static {
nameMigrationMap.put("akka-scala", new ScalaAkkaClientCodegen().getName());
nameMigrationMap.put("scala", new ScalaHttpClientCodegen().getName());
nameMigrationMap.put("jaxrs", new JavaJerseyServerCodegen().getName());
nameMigrationMap.put("qt5cpp", new CppQt5ClientCodegen().getName());
nameMigrationMap.put("cpprest", new CppRestSdkClientCodegen().getName());
nameMigrationMap.put("tizen", new CppTizenClientCodegen().getName());
nameMigrationMap.put("sinatra", new RubySinatraServerCodegen().getName());
nameMigrationMap.put("swift", new SwiftClientCodegen().getName());
nameMigrationMap.put("lumen", new PhpLumenServerCodegen().getName());
nameMigrationMap.put("slim", new PhpSlimServerCodegen().getName());
nameMigrationMap.put("ze-ph", new PhpZendExpressivePathHandlerServerCodegen().getName());
nameMigrationMap.put("nancyfx", new CSharpNancyFXServerCodegen().getName());
}
private String generatorName;
private String inputSpec;
private String outputDir;
@ -120,8 +103,6 @@ public class CodegenConfigurator implements Serializable {
this.setOutputDir(".");
}
// TODO: When setLang is removed, please remove nameMigrationMap and its usage(s).
/**
* Set the "language". This has drifted away from language-only to include framework and
* hyphenated generator types as well as language.
@ -150,15 +131,7 @@ public class CodegenConfigurator implements Serializable {
* @return The fluent instance of {@link CodegenConfigurator}
*/
public CodegenConfigurator setGeneratorName(final String generatorName) {
if (nameMigrationMap.containsKey(generatorName)) {
String newValue = nameMigrationMap.get(generatorName);
LOGGER.warn(String.format(Locale.ROOT,
"The name '%s' is a deprecated. Please update to the new name of '%s'.",
generatorName, newValue));
this.generatorName = newValue;
} else {
this.generatorName = generatorName;
}
return this;
}

View File

@ -38,7 +38,7 @@ public class PhpSlimServerOptionsProvider implements OptionsProvider {
@Override
public String getLanguage() {
return "slim";
return "php-slim";
}
@Override

View File

@ -11,5 +11,5 @@ declare curdir=$(cd $(dirname "${BASH_SOURCE}") && pwd)
declare clijar=${SWAGGER_CODEGEN_CLI_JAR:-$(cd $curdir && cd ../../../../../../../swagger-codegen-cli/target/ && echo $PWD)/swagger-codegen-cli.jar}
exec \java ${opts} -jar ${clijar} generate \
-i ${prefix}-spec.json -g scala \
-i ${prefix}-spec.json -g scala-httpclient-deprecated \
-o ${prefix}-expected;