[protobuf-schema] Replace zero value enum suffix from UNKNOWN to UNSPECIFIED#20473
[protobuf-schema] Replace zero value enum suffix from UNKNOWN to UNSPECIFIED#20473wing328 merged 2 commits intoOpenAPITools:masterfrom
Conversation
| */ | ||
| public void addUnknownToAllowableValues(Map<String, Object> allowableValues) { | ||
| if (startEnumsWithUnknown) { | ||
| public void addUnspecifiedToAllowableValues(Map<String, Object> allowableValues) { |
There was a problem hiding this comment.
@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.
@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? |
|
thanks for the PR, which has been merged pushed 61ae569 to update the doc |
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.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)