my-koop/service.website — pull request #213 by Cellule (2014-10-31 05:20:47+00:00)
Title: Added validation resolve and executing validation on actions

This makes it possible to run validation on data sent on an action on client side. And also be able to use that validation server side as well.
To add a validation function, you must create a file at `/moduleroot/lib/validation/index.ts` and inside you must export functions to validate. For example, I created a function named `updateItem`. The function returns an array of errors.
The decision for the return value was inspired by https://github.com/tdegrunt/jsonschema which will come in a later PR

Here's an example to add validation to your endpoints
```javascript
var endpoints = {
inventory: {
item: {
update: {
path: "/inventory/item/:id",
method: "put",
validation: {
resolve: "validation",
value: "updateItem"
}
}
```