You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to request support for a literal type in valkyrie. The feature should allow defining a literal value from a fixed set of options. For example, something like:
z.literal("full", "simplified", "none")
In addition to enforcing the literal value, I would also like the error message to clearly indicate the accepted literals when a validation fails. For instance, if the input does not match one of the defined literals (“full”, “simplified”, or “none”), the error message should display something like:
Invalid value provided. Expected one of: "full", "simplified", "none".
Thank you for considering this request!
The text was updated successfully, but these errors were encountered:
You're looking for choice(values: array, ..args), i.e. z.choice(("full", "simplified", "none")) (note the double parentheses), although it will not show the supported choices in the error message.
I would like to request support for a literal type in valkyrie. The feature should allow defining a literal value from a fixed set of options. For example, something like:
In addition to enforcing the literal value, I would also like the error message to clearly indicate the accepted literals when a validation fails. For instance, if the input does not match one of the defined literals (“full”, “simplified”, or “none”), the error message should display something like:
Thank you for considering this request!
The text was updated successfully, but these errors were encountered: