Find file
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (23 sloc) 712 Bytes


Validation is performed by the rules module, you can apply validation for the request body:

    respondsTo: [
        put: function(id, body) {

        schema:  {
            name: mustBe().populated().string({ maxLength: 50 })

You can apply the urlSchema to the entire resource (or at the method level if ypu prefer):

module.exports = new Resource({
    url: "/kittens/:id",
    urlSchema: {
        id: mustBe().numeric().populated()

Requests that do not adhere to the schema(s) will result in a 400 response code.