Skip to content

Commit

Permalink
Merge pull request #432 from justcoon/feature/proto3_optional
Browse files Browse the repository at this point in the history
add proto3 optional support
  • Loading branch information
ahjohannessen authored Nov 3, 2021
2 parents 6f90bdc + 5fb01ab commit f10fc47
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions codegen/src/main/scala/Fs2CodeGenerator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ object Fs2CodeGenerator extends ProtocCodeGenerator {

def handleCodeGeneratorRequest(request: PluginProtos.CodeGeneratorRequest): PluginProtos.CodeGeneratorResponse = {
val builder = CodeGeneratorResponse.newBuilder
builder.setSupportedFeatures(CodeGeneratorResponse.Feature.FEATURE_PROTO3_OPTIONAL.getNumber.toLong)
val genRequest = CodeGenRequest(request)
parseParameters(genRequest.parameter) match {
case Right((params, fs2params)) =>
Expand Down
19 changes: 19 additions & 0 deletions e2e/src/main/protobuf/test_proto3_optional.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";

package hello.world;

enum LogLevel {
TRACE = 0;
DEBUG = 1;
INFO = 2;
WARN = 3;
ERROR = 4;
FATAL = 5;
OFF = 6;
}

message LoggerConfiguration {
string name = 1;
LogLevel effectiveLevel = 2;
optional LogLevel configuredLevel = 3;
}

0 comments on commit f10fc47

Please sign in to comment.