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

[Rule-based type customization] Support for enum rules #61

Open
bjaglin opened this issue Jan 11, 2021 · 0 comments
Open

[Rule-based type customization] Support for enum rules #61

bjaglin opened this issue Jan 11, 2021 · 0 comments

Comments

@bjaglin
Copy link
Contributor

bjaglin commented Jan 11, 2021

Given the current generated code for proto enums and the lack of ScalaPB options to customize them, it's impossible to generically encode PGV enum rules as compile-time constraints.

  1. (validate.rules).enum.defined_only
  2. (validate.rules).enum.const
  3. (validate.rules).enum.in / (validate.rules).enum.not_in

(1) would be fairly simple to implement via something similar to #62

(2) is complex as it would require a generic solution for capturing constants (and pass them as string litterals?)

(3) has the same challenges as (2) and would require a generalized version of (1)

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