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

[REQUEST] - EnumSchema validator #3

Closed
natanfeitosa opened this issue Jan 23, 2023 · 0 comments
Closed

[REQUEST] - EnumSchema validator #3

natanfeitosa opened this issue Jan 23, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@natanfeitosa
Copy link
Owner

Is your feature request related to a problem? Please describe.
A scheme for validating enums
Kohi doesn't have an easy way for when I need to validate if the value is in a list of possible options like enum.Enum

Describe the solution you'd like

e = EnumSchema().one_of([1, 2, 3])
print(e.validate(1)) # True

e = EnumSchema().not_one_of([1, 2, 3])
print(e.validate(1)) # False
@natanfeitosa natanfeitosa added the enhancement New feature or request label Jan 23, 2023
natanfeitosa added a commit that referenced this issue Jan 26, 2023
added EnumSchema validator to resolve #3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant