forked from loafle/openapi-generator-original
Rename gRPC generator to "protobuf-schema" (#3864)
* rename grpc generator to protobuf-schema * update doc
This commit is contained in:
parent
d46bff9e78
commit
e73bf9be1d
@ -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)
|
**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**
|
**API documentation generators** | **HTML**, **Confluence Wiki**
|
||||||
**Configuration files** | [**Apache2**](https://httpd.apache.org/)
|
**Configuration files** | [**Apache2**](https://httpd.apache.org/)
|
||||||
**Others** | **GraphQL**, **JMeter**, **MySQL Schema**
|
**Others** | **GraphQL**, **JMeter**, **MySQL Schema**, **Protocol Buffer**
|
||||||
|
|
||||||
## Table of contents
|
## Table of contents
|
||||||
|
|
||||||
@ -768,6 +768,7 @@ Here is a list of template creators:
|
|||||||
* Avro: @sgadouar
|
* Avro: @sgadouar
|
||||||
* GraphQL: @wing328 [:heart:](https://www.patreon.com/wing328)
|
* GraphQL: @wing328 [:heart:](https://www.patreon.com/wing328)
|
||||||
* MySQL: @ybelenko
|
* MySQL: @ybelenko
|
||||||
|
* Protocol Buffer: @wing328
|
||||||
|
|
||||||
:heart: = Link to support the contributor directly
|
:heart: = Link to support the contributor directly
|
||||||
|
|
||||||
|
@ -27,6 +27,6 @@ fi
|
|||||||
|
|
||||||
# if you've executed sbt assembly previously it will use that instead.
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties $@"
|
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
|
java $JAVA_OPTS -jar $executable $ags
|
@ -5,6 +5,6 @@ If Not Exist %executable% (
|
|||||||
)
|
)
|
||||||
|
|
||||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
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%
|
java %JAVA_OPTS% -jar %executable% %ags%
|
@ -132,7 +132,7 @@ The following generators are available:
|
|||||||
## CONFIG generators
|
## CONFIG generators
|
||||||
* [apache2](generators/apache2)
|
* [apache2](generators/apache2)
|
||||||
* [graphql-schema](generators/graphql-schema)
|
* [graphql-schema](generators/graphql-schema)
|
||||||
* [grpc-schema (beta)](generators/grpc-schema)
|
* [protobuf-schema (beta)](generators/protobuf-schema)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
9
docs/generators/protobuf-schema.md
Normal file
9
docs/generators/protobuf-schema.md
Normal 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 |
|
||||||
|
| ------ | ----------- | ------ | ------- |
|
@ -41,9 +41,9 @@ import java.util.regex.Pattern;
|
|||||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||||
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
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";
|
protected String packageName = "openapitools";
|
||||||
|
|
||||||
@ -53,24 +53,24 @@ public class GrpcSchemaCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "grpc-schema";
|
return "protobuf-schema";
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getHelp() {
|
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();
|
super();
|
||||||
|
|
||||||
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
||||||
.stability(Stability.BETA)
|
.stability(Stability.BETA)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
outputFolder = "generated-code/grpc-schema";
|
outputFolder = "generated-code/protobuf-schema";
|
||||||
modelTemplateFiles.put("model.mustache", ".proto");
|
modelTemplateFiles.put("model.mustache", ".proto");
|
||||||
apiTemplateFiles.put("api.mustache", ".proto");
|
apiTemplateFiles.put("api.mustache", ".proto");
|
||||||
embeddedTemplateDir = templateDir = "grpc-schema";
|
embeddedTemplateDir = templateDir = "protobuf-schema";
|
||||||
hideGenerationTimestamp = Boolean.TRUE;
|
hideGenerationTimestamp = Boolean.TRUE;
|
||||||
modelPackage = "messages";
|
modelPackage = "messages";
|
||||||
apiPackage = "services";
|
apiPackage = "services";
|
@ -34,7 +34,6 @@ org.openapitools.codegen.languages.GoServerCodegen
|
|||||||
org.openapitools.codegen.languages.GoGinServerCodegen
|
org.openapitools.codegen.languages.GoGinServerCodegen
|
||||||
org.openapitools.codegen.languages.GraphQLSchemaCodegen
|
org.openapitools.codegen.languages.GraphQLSchemaCodegen
|
||||||
org.openapitools.codegen.languages.GraphQLNodeJSExpressServerCodegen
|
org.openapitools.codegen.languages.GraphQLNodeJSExpressServerCodegen
|
||||||
org.openapitools.codegen.languages.GrpcSchemaCodegen
|
|
||||||
org.openapitools.codegen.languages.GroovyClientCodegen
|
org.openapitools.codegen.languages.GroovyClientCodegen
|
||||||
org.openapitools.codegen.languages.KotlinClientCodegen
|
org.openapitools.codegen.languages.KotlinClientCodegen
|
||||||
org.openapitools.codegen.languages.KotlinServerCodegen
|
org.openapitools.codegen.languages.KotlinServerCodegen
|
||||||
@ -77,6 +76,7 @@ org.openapitools.codegen.languages.PhpSilexServerCodegen
|
|||||||
org.openapitools.codegen.languages.PhpSymfonyServerCodegen
|
org.openapitools.codegen.languages.PhpSymfonyServerCodegen
|
||||||
org.openapitools.codegen.languages.PhpZendExpressivePathHandlerServerCodegen
|
org.openapitools.codegen.languages.PhpZendExpressivePathHandlerServerCodegen
|
||||||
org.openapitools.codegen.languages.PowerShellClientCodegen
|
org.openapitools.codegen.languages.PowerShellClientCodegen
|
||||||
|
org.openapitools.codegen.languages.ProtobufSchemaCodegen
|
||||||
org.openapitools.codegen.languages.PythonClientCodegen
|
org.openapitools.codegen.languages.PythonClientCodegen
|
||||||
org.openapitools.codegen.languages.PythonClientExperimentalCodegen
|
org.openapitools.codegen.languages.PythonClientExperimentalCodegen
|
||||||
org.openapitools.codegen.languages.PythonFlaskConnexionServerCodegen
|
org.openapitools.codegen.languages.PythonFlaskConnexionServerCodegen
|
||||||
|
@ -7,7 +7,7 @@ These files were generated by the [OpenAPI Generator](https://openapi-generator.
|
|||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Package version:
|
- Package version:
|
||||||
- Build package: org.openapitools.codegen.languages.GrpcSchemaCodegen
|
- Build package: org.openapitools.codegen.languages.ProtobufSchemaCodegen
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user