Skip to content

Commit

Permalink
Rename gRPC generator to "protobuf-schema" (#3864)
Browse files Browse the repository at this point in the history
* rename grpc generator to protobuf-schema

* update doc
  • Loading branch information
wing328 committed Sep 10, 2019
1 parent d46bff9 commit e73bf9b
Show file tree
Hide file tree
Showing 26 changed files with 23 additions and 13 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
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/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
Original file line number Diff line number Diff line change
Expand Up @@ -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%
2 changes: 1 addition & 1 deletion docs/generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)



9 changes: 9 additions & 0 deletions docs/generators/protobuf-schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

---
id: generator-opts-config-protobuf-schema
title: Config Options for protobuf-schema
sidebar_label: protobuf-schema
---

| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
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";

Expand All @@ -53,24 +53,24 @@ public CodegenType getTag() {
}

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

Expand Down

0 comments on commit e73bf9b

Please sign in to comment.