Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lacking custom Protobuf options for enum #69

Open
dmytro-grankin opened this issue Feb 7, 2018 · 1 comment
Open

Add lacking custom Protobuf options for enum #69

dmytro-grankin opened this issue Feb 7, 2018 · 1 comment

Comments

@dmytro-grankin
Copy link
Contributor

Protobuf separates options for messages — google.protobuf.MessageOptions and for enums — google.protobuf.EnumOptions.

The framework defines custom options for messages, but there are no defined options for enums.

E.g. beta_type, experimental_type, internal_type, SPI_type options also make sense for enums. Java classes generated from messages with the options will additionally have corresponding annotations. ProtoAnnotatorPlugin does this work. Since new options will be added for enums, ProtoAnnotatorPlugin should be updated either to add annotations for enums.

EnumAnnotator already exists, so only a task for ProtoAnnotatorPlugin should be changed to use EnumAnnotator.

Besides the mentioned options, other custom options for messages should be reviewed and added for enums if it makes sense.

@alexander-yevsyukov
Copy link
Contributor

I've removed the bug label because until now we have not experienced the need for enum options marking them as internal, for example.

In the light of internal type filtering, we filter by message types, not by enum types. We cannot send an enum. Thus, having such options may be a thing for purists, but it's not a priority for the scope of 2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants