cbornet/generator-jhipster-grpc

Enums with same value names conflict

cbornet opened this issue · 2 comments

Protoc requires that enums of the same namespace don't have the same value names (eg: FooEnum.FOO and BarEnum.FOO). Probably because some languages don't have enum support...

com/mycompany/myapp/entity/foo.proto:48:5: "ENUM_VALUE_1" is already defined in "com.mycompany.myapp.entity".
com/mycompany/myapp/entity/foo.proto:48:5: Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it.  Therefore, "ENUM_VALUE_1" must be unique within "com.mycompany.myapp.entity", not just within "EnumRequiredFieldClassProto".

So enums should be extracted to their own namespace

Worse than that : if two entities have the same enum field name, there will be a conflict

Fixed by e913cce