mudskipper icon indicating copy to clipboard operation
mudskipper copied to clipboard

Sub Resource Validations Should Not Inherit Parent Resource Validators

Open joshua-mcginnis opened this issue 11 years ago • 1 comments

Whenever POST /resource has a payload validator, the POST method on a sub-resource appears to inherit that validator. Note that I haven't tried other methods or other use-cases (sub_sub_resources, etc).

POST /resource/123/sub_resource should not be griping about a validator on POST /resource, but it does.

However this is fixed, we'll still want to be able to validate the id on a subResource.

Example: /resource/:id/sub_resource, we should be able to add a validator for :id to the sub_resource to ensure it is present, int, and all that jazz.

caagency/caa-api2#419

joshua-mcginnis avatar Jan 28 '14 22:01 joshua-mcginnis

It looks like this also affects the auth: { scope: ... } config option.

A scope on /resource is being applied to /resource/:id/sub_resource.

joshua-mcginnis avatar Jan 29 '14 17:01 joshua-mcginnis