Closed duylam closed 6 years ago
I suppose this could be useful some time, but I'm pretty concerned that this could be a breaking change. Is there a strong need for this? Example?
I'm pretty concerned that this could be a breaking change
I think it doesn't break others because the extra parameter is in last location
Is there a strong need for this? Example?
Yes, let's say a request wants to create an object Group but it requires the group name
unique under current user tenant. So we want to validate whether the input groupd name
on request body existed under the tenant or not. It requires the validation method to see who is on the request (on Authorization
header or on a ctx.state.user
populated by another middleware).
Please update README. Also bump semver to 1.0.0 because this is a breaking change (yes, it would be rare, but since this change the argument list of call sites, there's always a possibility of something gets broken.)
@buunguyen Thanks, addressed the comment
Validation rule method can do more thing by accessing full the request info