1
0
Fork 0

Added longhand joi example.

This commit is contained in:
Alan Plum 2015-01-07 11:23:25 +01:00
parent 75cf182de2
commit 6b4443ca74
1 changed files with 15 additions and 0 deletions

View File

@ -496,6 +496,21 @@ extend(RequestContext.prototype, {
/// });
/// ```
///
/// Using a joi schema:
///
/// ```js
/// app.post("/foxx", function (req, res) {
/// var joiBody = req.parameters.joiBody;
/// // Do something with the number
/// }).bodyParam("joiBody", {
/// type: joi.number().integer().min(5),
/// description: "A number greater than five",
/// allowInvalid: false // default
/// });
/// ```
///
/// Shorthand version:
///
/// ```js
/// app.post("/foxx", function (req, res) {
/// var joiBody = req.parameters.joiBody;