Skip to content

Commit e73bf9b

Browse files
authored
Rename gRPC generator to "protobuf-schema" (#3864)
* rename grpc generator to protobuf-schema * update doc
1 parent d46bff9 commit e73bf9b

26 files changed

+23
-13
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
6969
**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)
7070
**API documentation generators** | **HTML**, **Confluence Wiki**
7171
**Configuration files** | [**Apache2**](https://httpd.apache.org/)
72-
**Others** | **GraphQL**, **JMeter**, **MySQL Schema**
72+
**Others** | **GraphQL**, **JMeter**, **MySQL Schema**, **Protocol Buffer**
7373

7474
## Table of contents
7575

@@ -768,6 +768,7 @@ Here is a list of template creators:
768768
* Avro: @sgadouar
769769
* GraphQL: @wing328 [:heart:](https://www.patreon.com/wing328)
770770
* MySQL: @ybelenko
771+
* Protocol Buffer: @wing328
771772

772773
:heart: = Link to support the contributor directly
773774

bin/grpc-schema-petstore.sh renamed to bin/protobuf-schema-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/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 $@"
30+
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 $@"
3131

3232
java $JAVA_OPTS -jar $executable $ags

bin/windows/grpc-schema-petstore.bat renamed to bin/windows/protobuf-schema-petstore.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ If Not Exist %executable% (
55
)
66

77
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
8-
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
8+
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
99

1010
java %JAVA_OPTS% -jar %executable% %ags%

docs/generators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ The following generators are available:
132132
## CONFIG generators
133133
* [apache2](generators/apache2)
134134
* [graphql-schema](generators/graphql-schema)
135-
* [grpc-schema (beta)](generators/grpc-schema)
135+
* [protobuf-schema (beta)](generators/protobuf-schema)
136136

137137

138138

docs/generators/protobuf-schema.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
---
3+
id: generator-opts-config-protobuf-schema
4+
title: Config Options for protobuf-schema
5+
sidebar_label: protobuf-schema
6+
---
7+
8+
| Option | Description | Values | Default |
9+
| ------ | ----------- | ------ | ------- |

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GrpcSchemaCodegen.java renamed to modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
import static org.openapitools.codegen.utils.StringUtils.camelize;
4242
import static org.openapitools.codegen.utils.StringUtils.underscore;
4343

44-
public class GrpcSchemaCodegen extends DefaultCodegen implements CodegenConfig {
44+
public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConfig {
4545

46-
private static final Logger LOGGER = LoggerFactory.getLogger(GrpcSchemaCodegen.class);
46+
private static final Logger LOGGER = LoggerFactory.getLogger(ProtobufSchemaCodegen.class);
4747

4848
protected String packageName = "openapitools";
4949

@@ -53,24 +53,24 @@ public CodegenType getTag() {
5353
}
5454

5555
public String getName() {
56-
return "grpc-schema";
56+
return "protobuf-schema";
5757
}
5858

5959
public String getHelp() {
60-
return "Generates gRPC and Protbuf schema files (beta)";
60+
return "Generates gRPC and protocol buffer schema files (beta)";
6161
}
6262

63-
public GrpcSchemaCodegen() {
63+
public ProtobufSchemaCodegen() {
6464
super();
6565

6666
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
6767
.stability(Stability.BETA)
6868
.build();
6969

70-
outputFolder = "generated-code/grpc-schema";
70+
outputFolder = "generated-code/protobuf-schema";
7171
modelTemplateFiles.put("model.mustache", ".proto");
7272
apiTemplateFiles.put("api.mustache", ".proto");
73-
embeddedTemplateDir = templateDir = "grpc-schema";
73+
embeddedTemplateDir = templateDir = "protobuf-schema";
7474
hideGenerationTimestamp = Boolean.TRUE;
7575
modelPackage = "messages";
7676
apiPackage = "services";

modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ org.openapitools.codegen.languages.GoServerCodegen
3434
org.openapitools.codegen.languages.GoGinServerCodegen
3535
org.openapitools.codegen.languages.GraphQLSchemaCodegen
3636
org.openapitools.codegen.languages.GraphQLNodeJSExpressServerCodegen
37-
org.openapitools.codegen.languages.GrpcSchemaCodegen
3837
org.openapitools.codegen.languages.GroovyClientCodegen
3938
org.openapitools.codegen.languages.KotlinClientCodegen
4039
org.openapitools.codegen.languages.KotlinServerCodegen
@@ -77,6 +76,7 @@ org.openapitools.codegen.languages.PhpSilexServerCodegen
7776
org.openapitools.codegen.languages.PhpSymfonyServerCodegen
7877
org.openapitools.codegen.languages.PhpZendExpressivePathHandlerServerCodegen
7978
org.openapitools.codegen.languages.PowerShellClientCodegen
79+
org.openapitools.codegen.languages.ProtobufSchemaCodegen
8080
org.openapitools.codegen.languages.PythonClientCodegen
8181
org.openapitools.codegen.languages.PythonClientExperimentalCodegen
8282
org.openapitools.codegen.languages.PythonFlaskConnexionServerCodegen

samples/config/petstore/grpc-schema/README.md renamed to samples/config/petstore/protobuf-schema/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ These files were generated by the [OpenAPI Generator](https://openapi-generator.
77

88
- API version: 1.0.0
99
- Package version:
10-
- Build package: org.openapitools.codegen.languages.GrpcSchemaCodegen
10+
- Build package: org.openapitools.codegen.languages.ProtobufSchemaCodegen
1111

1212
## Usage
1313

0 commit comments

Comments
 (0)