Skip to content

[general] Remove swagger-codegen "lang" mappings #2785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2019
Merged
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bin/openapi3/scala-akka-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion bin/openapi3/scala-httpclient-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -120,8 +103,6 @@ public CodegenConfigurator() {
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.
Expand Down Expand Up @@ -150,15 +131,7 @@ public CodegenConfigurator() {
* @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;
}
this.generatorName = generatorName;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class PhpSlimServerOptionsProvider implements OptionsProvider {

@Override
public String getLanguage() {
return "slim";
return "php-slim";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;