Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have access to request.app in Joi validation context #3451

Closed
cur3n4 opened this issue Mar 8, 2017 · 3 comments
Closed

Have access to request.app in Joi validation context #3451

cur3n4 opened this issue Mar 8, 2017 · 3 comments
Assignees
Labels
Milestone

Comments

@cur3n4
Copy link

@cur3n4 cur3n4 commented Mar 8, 2017

Are you sure this is an issue with hapi or are you just looking for some help?

Yes.

What are you trying to achieve or the steps to reproduce?

Sometimes during Joi validation on a route, it is useful to have access to request.app to check some values. Currently the Joi validation context contains request headers, params, query, payload, and auth.

What did you expect?

I would expect to be able to access request.app in Joi, same as the other request attributes

Context

  • node version:7.2.1
  • hapi version:13.2.1
  • os:MacOS

Let me know if this change makes sense to you and I can try to do a PR.

@AdriVanHoudt
Copy link
Contributor

@AdriVanHoudt AdriVanHoudt commented Mar 8, 2017

I think only a few properties are available since they are being copied into the context object.
So my only concern would be perf I think but if you send a massive payload you have the same issue I think.

/cc @Marsup

Loading

@Marsup
Copy link
Contributor

@Marsup Marsup commented Mar 8, 2017

I know for a fact it's not exposed, I don't know if @hueniverse wants to, sorry can't help you on this one.

Loading

@hueniverse hueniverse self-assigned this May 29, 2017
@hueniverse hueniverse added this to the 16.1.2 milestone May 29, 2017
@cur3n4
Copy link
Author

@cur3n4 cur3n4 commented May 29, 2017

Thanks a lot

Loading

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants