google / cel-spec

Common Expression Language -- specification and binary representation
https://cel.dev
Apache License 2.0
2.59k stars 216 forks source link

Add access to the descriptor (of a protobuf message). #351

Closed yangzh closed 2 months ago

yangzh commented 2 months ago

Feature description:

would it be possible to add access (from CEL) to the descriptor of a message (or a field, an enum, etc).

Problem it solves or use case: I would like to store the schema / descriptor of a protobuf message for a BLOB column (in database, for example), and it would be helpful if I can have a self-contained descriptor with the column via CEL.

Proposed implementation or solution:

This can be in the form of a new CEL function, like this:

descriptor(this) -> DescriptorProto

Contribution: No, but I'm happy to test / feedback.

yangzh commented 2 months ago

I happened to notice this previous issue (https://github.com/google/cel-spec/issues/320)