Skip to content

[cel-types] Add support for oneof field groups in CEL StructTypeDef. - #2415

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1008403947
Open

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1008403947

Conversation

@copybara-service

Copy link
Copy Markdown

[cel-types] Add support for oneof field groups in CEL StructTypeDef.

Previously, cel::StructTypeDef and its Protobuf and YAML representations modeled struct definitions strictly as a flat sequence of standalone fields, which could not directly express groups of mutually exclusive fields.

Extend cel::StructTypeDef with Oneof and Member (Field or Oneof), replacing the flat fields list with an ordered members list while enforcing field name uniqueness and FindField lookup across both standalone fields and Oneof groups. Update cel.types.Struct in typedef.proto (Member with field and oneof_type) and typedef_yaml (one_of_fields entries under struct.fields) along with their respective codecs.

Previously, `cel::StructTypeDef` and its Protobuf and YAML representations modeled struct definitions strictly as a flat sequence of standalone fields, which could not directly express groups of mutually exclusive fields.

Extend `cel::StructTypeDef` with `Oneof` and `Member` (`Field` or `Oneof`), replacing the flat `fields` list with an ordered `members` list while enforcing field name uniqueness and `FindField` lookup across both standalone fields and `Oneof` groups. Update `cel.types.Struct` in `typedef.proto` (`Member` with `field` and `oneof_type`) and `typedef_yaml` (`one_of_fields` entries under `struct.fields`) along with their respective codecs.

PiperOrigin-RevId: 1008403947
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant