Field Names with underscore getting converted to camel case after code generation

1,728 views
Skip to first unread message

Dinoop Thomas

unread,
Jan 11, 2019, 4:55:53 AM1/11/19
to ScalaPB
Hi,

I'm using the latest version of Scala PB 0.8.3.
The protobuf has messages where the field names are in snake case 

eg:

message myMessage {
    string input_data = 1;
    string output_data = 2;
}


The case class generated by Scala PB 0.8.3 has input_data replaced by inputData.

final case class myMessage  (
inputData:...
outputData:....
}

Is there a way I can continue to get input_data in the case class by passing certain additional flags ? Is this a known limitation of ScalaPB ?

Thanks and Regards,
Dinoop


Nadav Samet

unread,
Jan 11, 2019, 7:21:57 AM1/11/19
to Dinoop Thomas, ScalaPB
Hi Dinooo,

 This is the intended behavior which is the same as the official Java generator (https://developers.google.com/protocol-buffers/docs/reference/java-generated#fields). There's no way to make ScalaPB generate the field names as they are in the proto.

--
You received this message because you are subscribed to the Google Groups "ScalaPB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalapb+u...@googlegroups.com.
To post to this group, send email to sca...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalapb/422e866b-804e-4e0a-8f0f-713119bdd913%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages