Follow-up to discussion in #502 (review by @erikbosch).
In #502 we generate proto3 nested enums for string fields with allowed values, ordered by allowed list position. Proto3 assigns the first enum value to 0, which is also the implicit value when the field is unset on the wire.
VSS supports default on allowed-value fields. When a default is specified, the proto-default (enum 0 when field unset) does not currently carry that semantic — the enum ordering follows allowed order, not the default value.
Proposal
When a string field has both allowed and default:
- Sort the
allowed list with the default value first
- Generated nested enum then has
default at value 0
- Proto-default (unset field) aligns with VSS-default semantically
Out of scope of #502
#502 ships the basic generation. This issue tracks the semantic-alignment refinement as a separate change.
References
AI-assisted — authored with Claude, reviewed by Komada.
Follow-up to discussion in #502 (review by @erikbosch).
In #502 we generate proto3 nested enums for string fields with
allowedvalues, ordered byallowedlist position. Proto3 assigns the first enum value to 0, which is also the implicit value when the field is unset on the wire.VSS supports
defaulton allowed-value fields. When adefaultis specified, the proto-default (enum 0 when field unset) does not currently carry that semantic — the enum ordering followsallowedorder, not thedefaultvalue.Proposal
When a string field has both
allowedanddefault:allowedlist with thedefaultvalue firstdefaultat value 0Out of scope of #502
#502 ships the basic generation. This issue tracks the semantic-alignment refinement as a separate change.
References
AI-assisted — authored with Claude, reviewed by Komada.