mirror of https://gitee.com/bigwinds/arangodb
Added longhand joi example.
This commit is contained in:
parent
75cf182de2
commit
6b4443ca74
|
@ -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
|
/// ```js
|
||||||
/// app.post("/foxx", function (req, res) {
|
/// app.post("/foxx", function (req, res) {
|
||||||
/// var joiBody = req.parameters.joiBody;
|
/// var joiBody = req.parameters.joiBody;
|
||||||
|
|
Loading…
Reference in New Issue