Skip to content

Align nested enum value ordering with VSS default (proto3 zero-default semantics) #505

@aki1770-del

Description

@aki1770-del

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions