title | description |
---|---|
3 kinds Boolean support in ApiHug framework |
bool should has 2 flag, but 3 design ways really freak out. |
proto primitive:
//Define
bool flag =1;
//Assign
flag: true;
proto wrapper:
//Define
google.protobuf.BoolValue flag = 1;
//Assign
flag: {
value: true;
}
ApiHug Enum:
//Define
hope.common.BoolType flag = 1;
//Assign
flag: TRUE;
ApiHug | pros | cons | Comment |
---|---|---|---|
Proto Primitive | straightforward | default always false | as no default or optional present since proto3 |
Proto Wrapper | support not set | syntax a bit complex | when assign you need a message wrapper |
ApiHug Enum | straightforward | introduce depend on ApiHug Lib | only used in meta generation no affect on application layer |
Since ApiHug Lib 0.6.0-RELEASE
and IDE Plugin version 0.2.0
,avoid the usage of of Proto's primitive & wrapper ways, use ApiHug Enum as mandatory.
Otherwise the IDE plugin can not parse the AST tree, any bool dependent flag can not be picked up.