Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Access request in custom validators. #986
It certainly is. See https://github.com/intridea/grape/blob/master/lib/grape/validations/params_scope.rb#L8 for how it plucks various things at construction time - I think this is what you're looking for.
Use the mailing list for questions, if the above doesn't work post some code of what you'd like to accomplish.
changed the title from
Additional context in custom validations
Access request in custom validators.
Apr 17, 2015
@dblock Would you mind providing a more specific example of how we can get at the request from within a validator? I see that I can access the
(In my case, I'd like to get at the request path and headers)
EDIT: Oh, did you re-open this cause you saw that there wasn't a way to achieve this after all?