3 ms·
https://github.com/armstnp/validryad https://github.com/armstnp/validryad > Other validation tools are either focused on: > - binding to user input forms, >
by Fellshard 5y ago
https://github.com/armstnp/validryad https://github.com/armstnp/validryad
> Other validation tools are either focused on:
> - binding to user input forms,
> - recreating or supplementing ActiveRecord validations, or
> - supplying user-friendly error messages instead of programmatic error codes
>
> This is a design gap I'm interested in filling, as it fits my mental model for many validation cases, and is especially suitable for APIs in a way other Ruby validation libraries are not.
>
>The aim, then, is for Validryad to be a validation library that supplies programmatically useful validation errors, while performing some minimal coercion and alteration of the data as useful.
>
> The library draws on the existing dry-validation library for design inspiration, while making some concretely different decisions:
>
> - Error messages are programmatic, not user-based
> - Validation is not tailored towards hashes alone, but suited for any combination of values, including hashes and arrays
It's extremely basic, but I'm using it for current work and it does the job I need it to do. It was a simple enough tool that I figured it might be useful to push as its own library. Looking at recent discussion, it probably better fits the 'parse, don't validate' mentality, under which case it's something of a misnomer.