Open
Description
Example
Input
syntax = "proto3";
package test;
message SubType {
enum Type {
TYPE_1 = 0;
TYPE_2 = 1;
}
Type field_1 = 1;
uint64 field_2 = 2;
oneof OneOfField {
int32 field_3 = 3;
double field_6 = 6;
}
}
Output
syntax = "proto3";
namespace test {
struct SubType {
enum Type {
TYPE_1 = 0,
TYPE_2 = 1,
};
Type field_1 = 1;
uint64 field_2 = 2;
oneof OneOfField {
int32 field_3 = 3;
double field_6 = 6;
};
};
}
In documentation, one would expect that field_3 could be referenced as test::SubType::field_3
or test::SubType::OneOfField::field_3
. However, the field is not accessible as oneof is not a C++ type.
Once the style is chosen (i.e, test::SubType3::field_3
or test::SubType3::OneOfField::field_3
) the fix is relatively simple.