question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong Proto outer classname in generated code, does not compile

See original GitHub issue

Given a proto file ServiceM:

syntax = "proto3";
package com.mycompany;

service ServiceM {...}
message reqM {...}

Generated object ServiceMGrpcKt refers to Servicem.reqM, that doesn’t exist. The correct outer classname is ServiceMOuterClass. This makes the plugin unusable unless the outer classname is explicitly specified in the proto file.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bshaffercommented, Oct 20, 2020

Oh, I see you mean the contents of the commit message, not the format. The style guide recommends camel case, so it’s in reference to that.

0reactions
asarkarcommented, Oct 20, 2020

The style guide recommends camel case

https://developers.google.com/protocol-buffers/docs/style#message_and_field_names

I’m guessing you’re referring to the following:

Use CamelCase (with an initial capital) for message names

and the name of the proto file is irrelevant. Correct?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generated code doesn't compile if lowercase type name ...
proto : The file's outer class name, "TestConflictMessage3", matches the name of one of the types declared inside it when case is ignored....
Read more >
Java Generated Code | Protocol Buffers - Google Developers
proto 's Java package is com.example and it doesn't enable java_multiple_files and its outer classname is FooProtos , then the protocol buffer compiler...
Read more >
How to rename field in generated Java class to prevent ...
Here is a small example. Protobuffer using a Java reserved keyword. package wrong.name; option java_outer_classname = "WrongProtos"; ...
Read more >
java class name different from proto file name - Google Groups
I got a strange behaviour when compiling a protofile (e.g. MyClass.proto). The generated java class is then called MyClassProto. All other proto files...
Read more >
java/README.txt - platform/external/protobuf - Git at Google
1) Install Apache Maven if you don't have it: http://maven.apache.org/ · 2) Build the C++ code, or obtain a binary distribution of protoc....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found