Rename gRPC generator to "protobuf-schema" (#3864)

* rename grpc generator to protobuf-schema

* update doc
This commit is contained in:
William Cheng 2019-09-10 17:32:25 +08:00 committed by GitHub
parent d46bff9e78
commit e73bf9be1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 23 additions and 13 deletions

View File

@ -69,7 +69,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
**Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, 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/)
**Others** | **GraphQL**, **JMeter**, **MySQL Schema**
**Others** | **GraphQL**, **JMeter**, **MySQL Schema**, **Protocol Buffer**
## Table of contents
@ -768,6 +768,7 @@ Here is a list of template creators:
* Avro: @sgadouar
* GraphQL: @wing328 [:heart:](https://www.patreon.com/wing328)
* MySQL: @ybelenko
* Protocol Buffer: @wing328
:heart: = Link to support the contributor directly

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/grpc-schema -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g grpc-schema -o samples/config/petstore/grpc-schema --additional-properties packageName=petstore $@"
ags="generate -t modules/openapi-generator/src/main/resources/protobuf-schema -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g protobuf-schema -o samples/config/petstore/protobuf-schema --additional-properties packageName=petstore $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -5,6 +5,6 @@ If Not Exist %executable% (
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -t modules\openapi-generator\src\main\resources\grpc-schema -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g grpc-schema -o samples\config\petstore\grpc-schema
set ags=generate -t modules\openapi-generator\src\main\resources\protobuf-schema -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g protobuf-schema -o samples\config\petstore\protobuf-schema
java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -132,7 +132,7 @@ The following generators are available:
## CONFIG generators
* [apache2](generators/apache2)
* [graphql-schema](generators/graphql-schema)
* [grpc-schema (beta)](generators/grpc-schema)
* [protobuf-schema (beta)](generators/protobuf-schema)

View File

@ -0,0 +1,9 @@
---
id: generator-opts-config-protobuf-schema
title: Config Options for protobuf-schema
sidebar_label: protobuf-schema
---
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |

View File

@ -41,9 +41,9 @@ import java.util.regex.Pattern;
import static org.openapitools.codegen.utils.StringUtils.camelize;
import static org.openapitools.codegen.utils.StringUtils.underscore;
public class GrpcSchemaCodegen extends DefaultCodegen implements CodegenConfig {
public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(GrpcSchemaCodegen.class);
private static final Logger LOGGER = LoggerFactory.getLogger(ProtobufSchemaCodegen.class);
protected String packageName = "openapitools";
@ -53,24 +53,24 @@ public class GrpcSchemaCodegen extends DefaultCodegen implements CodegenConfig {
}
public String getName() {
return "grpc-schema";
return "protobuf-schema";
}
public String getHelp() {
return "Generates gRPC and Protbuf schema files (beta)";
return "Generates gRPC and protocol buffer schema files (beta)";
}
public GrpcSchemaCodegen() {
public ProtobufSchemaCodegen() {
super();
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
.stability(Stability.BETA)
.build();
outputFolder = "generated-code/grpc-schema";
outputFolder = "generated-code/protobuf-schema";
modelTemplateFiles.put("model.mustache", ".proto");
apiTemplateFiles.put("api.mustache", ".proto");
embeddedTemplateDir = templateDir = "grpc-schema";
embeddedTemplateDir = templateDir = "protobuf-schema";
hideGenerationTimestamp = Boolean.TRUE;
modelPackage = "messages";
apiPackage = "services";

View File

@ -34,7 +34,6 @@ org.openapitools.codegen.languages.GoServerCodegen
org.openapitools.codegen.languages.GoGinServerCodegen
org.openapitools.codegen.languages.GraphQLSchemaCodegen
org.openapitools.codegen.languages.GraphQLNodeJSExpressServerCodegen
org.openapitools.codegen.languages.GrpcSchemaCodegen
org.openapitools.codegen.languages.GroovyClientCodegen
org.openapitools.codegen.languages.KotlinClientCodegen
org.openapitools.codegen.languages.KotlinServerCodegen
@ -77,6 +76,7 @@ org.openapitools.codegen.languages.PhpSilexServerCodegen
org.openapitools.codegen.languages.PhpSymfonyServerCodegen
org.openapitools.codegen.languages.PhpZendExpressivePathHandlerServerCodegen
org.openapitools.codegen.languages.PowerShellClientCodegen
org.openapitools.codegen.languages.ProtobufSchemaCodegen
org.openapitools.codegen.languages.PythonClientCodegen
org.openapitools.codegen.languages.PythonClientExperimentalCodegen
org.openapitools.codegen.languages.PythonFlaskConnexionServerCodegen

View File

@ -7,7 +7,7 @@ These files were generated by the [OpenAPI Generator](https://openapi-generator.
- API version: 1.0.0
- Package version:
- Build package: org.openapitools.codegen.languages.GrpcSchemaCodegen
- Build package: org.openapitools.codegen.languages.ProtobufSchemaCodegen
## Usage