Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List of defined enum values #674

Open
Alfus opened this issue Apr 4, 2023 · 0 comments
Open

List of defined enum values #674

Alfus opened this issue Apr 4, 2023 · 0 comments

Comments

@Alfus
Copy link

Alfus commented Apr 4, 2023

Change
I would like to be able to test a value against the list of defined enum values for a given enum type.

I am trying to replicate the feature, as seen in https://github.com/bufbuild/protoc-gen-validate/blob/main/validate/validate.proto#L702

Example
foo.myEnumField in package.MyEnum.values()

In the validation rules, the type of the enum cannot be given statically in the program, so it would also need to work on the type
foo.myEnumField in enum_values(type(foo.MyEnumField))

Alternatives considered
A custom helper function in every CEL language

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

No branches or pull requests

1 participant