Open torepettersen opened 5 months ago
Sorry, didn't realice I could just use:
%{
required(:some_enum) => type(:any, in?: ["some_string", 1, :some_atom])
}
Thanks for reporting this, I actually think there's a place for a first-class Enum type here
Thanks again for this lovely library :blush:
Would you consider adding Enum's to this library? Seems like it is a common enough use case that it is suppored for JSON Schemas.
Not sure what the best way to add enum support would be, but I would be happy to contribute.
One option could be an enum type:
The other option seems like adding a validation in
Drops.Predicates
.Seems like we would need a validation either way. So might make sense to start there? Any maybe add a enum type where the
values
would be a required validation?