-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix problem with underscores in rpc names #95
Conversation
|
@@ -39,6 +39,16 @@ data class MemberSimpleName(val name: String) : CharSequence by name { | |||
val OPERATOR_MINUS_ASSIGN = MemberSimpleName("minusAssign") | |||
} | |||
|
|||
fun handleSpecialCharacters(): MemberSimpleName{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a space before the { and, on the next line, after the if.
@@ -23,7 +23,7 @@ import com.google.protobuf.Descriptors.MethodDescriptor | |||
/** Represents the unqualified name of an RPC method in a proto file, in UpperCamelCase. */ | |||
data class ProtoMethodName(val name: String) : CharSequence by name { | |||
fun toMemberSimpleName(): MemberSimpleName = | |||
MemberSimpleName(CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, name)) | |||
MemberSimpleName(CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, name)).handleSpecialCharacters() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This honestly looks like the processing ought to happen here, not in MemberSimpleName.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved code from MemberSimpleName and split into two methods
package io.grpc.testing.underscore; | ||
option java_multiple_files = true; | ||
service NameContainsUnderscore { | ||
rpc say_hello (HelloRequest) returns (HelloReply); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test case for say_hello_again
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added say_hello_again
to proto and also unit test for this case to verify the behavior for names with multiple underscores
Fix for #94
Added underscore in method name support.
Also added example of proto file and test for new behavior.