-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[protobuf-schema] Replace zero value enum suffix from UNKNOWN to UNSPECIFIED #20473
base: master
Are you sure you want to change the base?
Conversation
@@ -249,22 +250,21 @@ public void addEnumValuesPrefix(Map<String, Object> allowableValues, String pref | |||
* | |||
* @param allowableValues allowable values | |||
*/ | |||
public void addUnknownToAllowableValues(Map<String, Object> allowableValues) { | |||
if (startEnumsWithUnknown) { | |||
public void addUnspecifiedToAllowableValues(Map<String, Object> allowableValues) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lucy66hw just a question please, reading the https://protobuf.dev/best-practices/dos-donts/#unspecified-enum. it seems like the right name for first element should have UNSPECIFIED
suffix, fe <enum_name>_UNSPECIFIED
. Shouldn't we follow this convention? Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@reta thanks for comment. yes, this is the target of the PR. It replaces the current zero enum suffix from UNKNOWN
to UNSPECIFIED
. The enum_name prefix will be added by function addEnumValuesPrefix
, resulting in the zero enum being named <enum_name>_UNSPECIFIED
@wing328 wondering if you could find a time to look into this small change, thank you |
@wing328 could you look into this pr? |
ref #20472
Based on protobuf style guide The zero value enum should have the suffix UNSPECIFIED.
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master
(upcoming7.x.0
minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)