toddjordan / ember-cli-dynamic-forms

An Ember addon for creating dynamic forms
http://toddjordan.github.io/ember-cli-dynamic-forms/
MIT License
35 stars 16 forks source link

Should allow for multiple validators on a single field #22

Open toddjordan opened 8 years ago

toddjordan commented 8 years ago

This is not a current capability of alpaca, but since we are making validators reusable with ember-cli-dynamic-forms, we want to support it.

With this feature, the validator field has the option to be specified as an array, for example:

{
  "schema": {
      ...
      "beverage": {
        "type": "string",
        "enum": ["water", "soda", "beer", "wine"]
      }
    }
  },
  "options": {
      ...
      "beverage": {
        "label": "Choice of Beverage",
        "slider": true,
        "validator": ["drinking-age", "non-negative"]
      }
    }
  }
}

Both validations should be executed, one or both messages if any validations are not met