-
Notifications
You must be signed in to change notification settings - Fork 2
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
Protect from typos in route definitions #52
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was there on purpose, platform-backend is using extra fields to do some magic https://github.com/BrandEmbassy/platform-backend/blob/master/application/Configs/api/engager.neon#L41
Maybe we can just introduce alias middleware = middlewares
@dominikvoda OK, I get that use case, so I've allowed extra fields back (971b87e), made a supersimple check for that specific typo (bdec72d) and then generalized it to disallowing any config keys that are different, but very similar (1 or 2 changed characters) to the ones we've defined (53e2d9e). This should provide at least some protection from typos and not interfere with extra fields in other projects. |
It's quite easy to make a typo in the configuration (eg
middleware
/middlewares
), and some middlewares have effects that are not immediately obvious.Loading route configs should fail with additional info when such misconfiguration happens, imo. It was surprising that there was a test for allowing extra fields - is there a use case for this?