lukerandall
lukerandall

Reputation: 2212

Validation separate from form declaration in Yesod

From what I've seen from the Yesod book, validation happens with forms. Coming from an MVC background - where validation happens on the model - this feels like a conflation of concerns. For example, I am looking to build a JSON API using Yesod, and can't see an obvious way of using validation separate from forms.

Is it just a preconceived notion of mine that Form == HTML form, and forms are the right way to ingest data, regardless of the source? Is there some other way that I've ignorant of? If there is some other way, does this not represent a duplication of code in terms of the validations having to be applied to the various data ingress methods?

Upvotes: 3

Views: 108

Answers (1)

Anton
Anton

Reputation: 2585

try look at this digestive-functors and this digestive-functors-aeson

Upvotes: 1

Related Questions