Skip to content

Conversation

@srinivasiyer
Copy link

The change is pretty light weight that allows nested object bodies and array notations in URLS to be validated using a '.' separator

http://localhost:3000?foo[bar]=foobar can be validated as

this.checkQuery('foo.bar').eq('foobar')

the above example would require the koa-qs library to parse the get params

Also a body of

{
  "foo": [{"bar": "foobar"}]
}

can be validated using

this.checkBody('foo.0.bar').eq('foobar', 'Needs to be foobar');

I have worked with nested bodies in many projects and this would really useful if you can merge the request.

@coveralls
Copy link

Coverage Status

Coverage decreased (-75.67%) to 21.36% when pulling a5af795 on srinivasiyer:master into 0252d70 on RocksonZeta:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants