-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
helpers injection pollutes Grape::Middleware::Error #1420
Comments
Good hunting, this looks like a real problem. |
Good point, thanks @etehtsea for reporting the issue! |
@dblock despite of some other breaking changes, this fix seems to work. |
@etehtsea What are you seeing wrt breaking changes that you didn't expect? Are those described in UPGRADING? |
The one that wasn't mention in README is #1390. It changes Two other are:
This is not issues with the grape itself, but as for me it looks like lack of private/public API separation (the same for grape-entity). As a result, every minor improvement can break project based on grape/grape-entity. P.S. I don't mean anything negative, just wanted to give a little feedback. |
Thanks. I think even for internals like these we should document them since at least someone relies on it. Would you like to PR some updates to UPGRADING @etehtsea? |
This commit introduces very strange issues in our projects:
helpers are including to the middleware which is global to all code that use Grape. So if you have two helpers with the same name you are in trouble.
Upsy daisy!
Historically in order to not copy pasting
format
/helpers
and other to each endpoint we haveBase
endpoint like in example from which we subclass all other. After this commithelpers
are injecting over and over and ancestors list grows from~11
toN * endpoints + 11
.Possibly this is not an issue by itself and could be fixed by moving helpers to the root class where all other endpoints are mounted, but I could not get it to work (helpers behaviour inconsistency #1418).
The text was updated successfully, but these errors were encountered: