I'm trying to use swift-protobuf:
$ protoc --version
libprotoc 3.3.0
$ protoc-gen-swift --version
protoc-gen-swift 0.9.904
I have Test.proto
file, which I need to convert to Test.pb.swift
:
syntax = "proto2";
message Test {
optional int64 TestId = 1 [default = 0];
}
To do this I'm using:
$ protoc --swift_opt=Visibility=Public --swift_out=./ ./Test.proto
It generate's long .pb.swift file:
public struct Test: SwiftProtobuf.Message {
public static let protoMessageName: String = "Test"
public var testID: Int64 {
get {return _testID ?? 0}
set {_testID = newValue}
}
/// Returns true if `testID` has been explicitly set.
....
So, why TestId
converted to testID
, e.g. why Id
capitalized to ID
?
How to fix or avoid this capitalization behavior?