Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Compare: Parameter Validation

Showing with 38 additions and 0 deletions.
  1. +38 −0 Parameter-Validation.md
View
38 Parameter-Validation.md
@@ -19,4 +19,42 @@ Validations should be included with every parameter requiring validation.
}
}
}
+```
+
+[saary]
+```json
+{
+ "params": {
+ "email": {
+ "doc": "A valid email address",
+ "style": "query",
+ "type": "string",
+ "required": true
+ "validations": [
+ {
+ "type": "match",
+ "value": "/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/"
+ },
+ {
+ "type": "exclude",
+ "value": ["example@example.com"]
+ }
+ ]
+ }
+ },
+ "age": {
+ "doc": "the user's age",
+ "style": "query",
+ "required": false,
+ "validations": [
+ {
+ "type": "numeric"
+ },
+ {
+ "type": "range",
+ "value": "20.."
+ }
+ ]
+ }
+}
```
Something went wrong with that request. Please try again.