Skip to content

[cel-types] Add FileDescriptorSetToTypeDefSet descriptor conversion. - #2427

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

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

Conversation

@copybara-service

Copy link
Copy Markdown

[cel-types] Add FileDescriptorSetToTypeDefSet descriptor conversion.

CEL type definitions need a direct bridge from compiled Protocol Buffers FileDescriptorSet schemas into cel::TypeDefSet so message and enum definitions can be inspected, serialized, and later reconstructed.

Implement FileDescriptorSetToTypeDefSet in common/typedef/proto_to_typedef to convert non-well-known proto2, proto3, and editions message and enum descriptors into TypeDefSet, documenting dialect-specific protobuf features that are intentionally omitted. Standard CEL well-known types map to their built-in TypeSpec equivalents, synthetic map-entry messages collapse into map<K, V> fields, real protobuf oneof declarations map to StructTypeDef::Oneof groups, and "proto" cel::Aspect properties capture file names, allow_alias, field numbers, custom json_name overrides, non-default field types, and oneof names alongside explicit proto2 defaults and leading source comments.

CEL type definitions need a direct bridge from compiled Protocol Buffers `FileDescriptorSet` schemas into `cel::TypeDefSet` so message and enum definitions can be inspected, serialized, and later reconstructed.

Implement `FileDescriptorSetToTypeDefSet` in `common/typedef/proto_to_typedef` to convert non-well-known `proto2`, `proto3`, and `editions` message and enum descriptors into `TypeDefSet`, documenting dialect-specific protobuf features that are intentionally omitted. Standard CEL well-known types map to their built-in `TypeSpec` equivalents, synthetic map-entry messages collapse into `map<K, V>` fields, real protobuf `oneof` declarations map to `StructTypeDef::Oneof` groups, and `"proto"` `cel::Aspect` properties capture file names, `allow_alias`, field numbers, custom `json_name` overrides, non-default field types, and `oneof` names alongside explicit `proto2` defaults and leading source comments.

PiperOrigin-RevId: 1010058776
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