Re: Clojure Spec and Human Readable Error Messages

2020-02-15 Thread John Shaffer
David, I've published code204/spec-forms 0.1.0-alpha2 to Clojars. It works fine for simple specs (meaning I haven't tried it on anything crazy yet) and can be used with phrase as well. It's only about 50 lines, so I tried to cover everything in the README: https://github.com/code204/spec-forms#spe

Re: Clojure Spec and Human Readable Error Messages

2020-02-03 Thread David Simmons
Many thanks John. I'll check out phrase. If you do get something working I'd love to see it as your approach seems the simplest to me. cheers Dave On Monday, February 3, 2020 at 10:27:08 PM UTC, John Shaffer wrote: > > The phrase library can create human-readable error messages: > https://gith

Re: Clojure Spec and Human Readable Error Messages

2020-02-03 Thread John Shaffer
The phrase library can create human-readable error messages: https://github.com/alexanderkiel/phrase I've been working on something for a more natural (to me) approach, with the ability to define error messages in-line with the predicate. E.g., (s/defop max-length [n] (sf/validator #(>= n (

Clojure Spec and Human Readable Error Messages

2020-02-03 Thread David Simmons
Hi All. I've just come back to Clojure (after being away for a few years) and I'm incredibly impressed with how things have moved on. I particuarly like Clojure Spec but I'm struggling to understand how I can convert coercion erros to a human friendly for for end users to understand on a websit