Skip to content

Parameter Validation

grncdr edited this page Apr 15, 2012 · 3 revisions

Validations should be included with every parameter requiring validation.

Example

{
  "parameters": {
    "email": {
      "description": "A valid email address",
      "validations": [
        {
          "type": "match",
          "challenge": "/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/"
        },
        {
          "type": "exclude",
          "challenge": ["example@example.com"]
        }
      ]
    }
  }
}

Clone this wiki locally