-
Notifications
You must be signed in to change notification settings - Fork 14
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
Route validation does not work #67
Comments
So it turns out validation works on everything but body. |
It looks like the bug was created by not handling the hapi compatible payload correctly. |
No in fact it's because you need to use hapi notation (at least it was designed like this) and use |
Express is not hapi. That's counterintuitive and confusing for express users. I think it should support both. |
Route definition is global to Trails project whatever the web server (and not hapi/express specific), meaning that whatever the definition you have here, it has to work for any web server under the hood. The trails team choose to base his route definition on the hapi one that's why it use payload and not body. Sure we can support body but in that case trailpack-hapi will have to support it too, but for me it's not a good thing to offer the same functionality with two different name. What we can do is to enhance the route definition validation here https://github.com/trailsjs/trailpack-router/blob/master/lib/schemas/route.js#L21 to add the missing validation. Like this when someone put If someone have other opinion/idea you're welcome @trailsjs/maintainers :) |
Ok, I guess that makes sense. I'm happy to at least know what the issue was. I need to use payload instead of body. |
I cannot seem to get route validation to work.
My config looks like the following . . .
The text was updated successfully, but these errors were encountered: