Closed jacobmikesell closed 1 month ago
Hi @jacobmikesell, you'll want to use optional values; however, this likely requires an update to the ProtoContext
method to support generation of optional bindings for all fields such that set field are optional.of(value)
and unset fields are optional.none()
@TristonianJones would this require optional
to be used in the proto definition file? or do you mean that we could say (for only root message fields of type message) that they are optional in the cel context?
@jacobmikesell I was referring to the cel-go notion of cel.OptionalTypes()
to be enabled. When enabled, you could generation CEL-optional bindings for fields whose type are optional_type(<field_type>)
and when unpopulated, the value would be optional.none()
Feature request checklist
Change Summary of the proposed change and some details about what problem it helps solve.
I'm curious if there is a better way to test precense/defaultness of a protobuf message when its not a "field" but at the root of the cel AST
Example