usefulio / forms

The forms super-powers your Templates always wanted.
42 stars 1 forks source link

Validation should be pluggable #31

Open gevou opened 9 years ago

gevou commented 9 years ago

Built-in validators in validators.js have been built based on a previous version of the Forms API which passed all the parameters to a validator function as a single context object. (see line 1 of validators.js)

They should be updated in order to reflect the new API and allow the following usage syntax within a schema: carType: Forms.validators.oneOf([ 'sport', 'sedan', ... ])

cwohlman commented 9 years ago

Also, the forms validation api should be updated to pass in more information (e.g. the form instance, the document, etc.)

-- Joshua Ohlman Lead Developer Useful IO (361) 772-4201 joshua@useful.io joshua@useful.io

On Mon, Aug 31, 2015 at 2:49 PM, gevou notifications@github.com wrote:

Built-in validators in validators.js have been built based on a previous version of the Forms API which passed all the parameters to a validator function as a single context object. (see line 1 of validators.js)

They should be updated in order to reflect the new API and allow the following usage syntax within a schema: carType: Forms.validators.oneOf([ 'sport', 'sedan', ... ])

— Reply to this email directly or view it on GitHub https://github.com/usefulio/forms/issues/31.

ianserlin commented 9 years ago

Let's take this in the direction of while we provide a set of validations (that we can separate into another package), let's make a flexible enough api for people to easily plug in their own validation, or at least easily create a connector between something like Astronomy's validations and the forms api so they can choose how to validate without again writing a lot of duplicate validations or boilerplate.

richpowell commented 8 years ago

any updates on validation? Or some tips how to roll my own? maybe with the {{error}}