Open johan44co opened 1 year ago
Hi @johan44co - I'm wondering if this is an issue with your enum definitions. I know for the C# generation, to get the expected output, the enum items must all be prefixed with the enum name. For instance, the Groups
enum should be
enum Groups {
GROUPS_UNKNOWN = 0;
GROUPS_TEST_0 = 1;
GROUPS_TEST_1 = 2;
}
The C# enum for the above would be generated as
public enum Groups {
Unknown,
Test0,
Test1
}
With your current proto definition, the C# code that gets generated would be:
public enum Groups {
UnknownGroups,
Test0,
Test1
}
For your Unlisted
enum, since they are not all prefixed with UNLISTED_
, the code generation would fail to recognize the prefix, and each item would simply be converted to pascal case in c#. I'm assuming the ts protobuf generator will do something similar with the naming conventions.
left code generated using; namely/protoc:1.42_2 right code generated using; namely/protoc-all:1.51_1![Screenshot 2023-02-08 at 14 29 49](https://user-images.githubusercontent.com/7954209/217543681-062ea696-3354-4fbe-b413-f4b584dcbc68.png)
I have tried passing the option
--ts_opt useOptionals=none
but it does not have any effectProto definition for reference