Files
swift-protobuf/PluginExamples
Franz Busch 747d8b0205 Add an EnumGeneration option to generate @nonexhaustive enums and oneofs (#1987)
# Motivation

Swift protobuf currently generates exhaustive (aka frozen) enums;
however, in proto3 enums and oneofs are open and it is binary and wire
compatible to add new cases to either.

# Modifications

This PR introduces a new generator option called `EnumGeneration` that
allows developers to add the newly introduced `@nonexhaustive` attribute
to enums. Because adding this attribute is a source breaking change the
default stays the same as it currently is. Additionally, this PR adds
multiple tests for the protoc plugin and SwiftPM plugin.

# Result

We can now generate `@nonexhaustive` enums and oneofs.
2026-02-25 15:22:28 +00:00
..