drogon
drogon copied to clipboard
Does drogon have a recommended way to do parameter validation for HttpRequest?
Maybe
- Use an annotation like Spring of Java. (impossible)
- Use a common filter, and the rules for validation can be transferred into it in a way.
- Inject different filter into different HttpController method. (Use if-else in the filter)
- Use if-else in every post-put handler method.
Thanks for the feature request. Drogon currently doesn’t have a “sanctioned” way to do input validation. The options you already presented are currently the way to go.
This is indeed something I could imagine being part of the core framework.
Can someone give some examples for input validation?