-
Notifications
You must be signed in to change notification settings - Fork 75
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
Support range/length refinement providers for enums #1283
Conversation
@@ -82,6 +83,12 @@ object RefinementProvider { | |||
implicit def mapLengthConstraint[K, V]: Simple[Length, Map[K, V]] = | |||
new LengthConstraint[Map[K, V]](_.size) | |||
|
|||
implicit def enumLengthConstraint[E <: Enumeration.Value]: Simple[Length, E] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: should we also have @pattern
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@idRef
would be nasty. If someone ever creates an enum that matches the ShapeId format, I'll personally go to their house and remove their github account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: should we also have @pattern?
Is it allowed ? you mentioned range and length, but ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't check the others! 😅
Co-authored-by: Jakub Kozłowski <[email protected]>
Fixes #1282
PR Checklist (not all items are relevant to all PRs)