Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation should be pluggable #31

Open
gevou opened this issue Aug 31, 2015 · 3 comments
Open

Validation should be pluggable #31

gevou opened this issue Aug 31, 2015 · 3 comments

Comments

@gevou
Copy link
Contributor

gevou commented Aug 31, 2015

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', ... ])

@gevou gevou changed the title Validators should be updated to current Forms logic Built-in validators should be updated to the new Forms API Aug 31, 2015
@cwohlman
Copy link
Contributor

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
[email protected] [email protected]

On Mon, Aug 31, 2015 at 2:49 PM, gevou [email protected] 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
#31.

@ianserlin ianserlin changed the title Built-in validators should be updated to the new Forms API Validation should be pluggable Sep 8, 2015
@ianserlin
Copy link
Member

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants