# Joi version 17+

**URL:** <https://forum.codewithmosh.com/t/joi-version-17/992>\
**Category:** Node\
**Created:** [November 29, 2020, 4:36am UTC](https://forum.codewithmosh.com/t/joi-version-17/992 "2020-11-29T04:36:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![A100D-JS](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/a100d-js/32/8_2.png) [@A100D-JS](https://forum.codewithmosh.com/u/A100D-JS)\
**Post date:** [November 29, 2020, 12:33pm UTC](https://forum.codewithmosh.com/t/joi-version-17/992/2 "2020-11-29T12:33:09Z")

</div>

Hi,

```auto
 // Joi Version -> 17
     app.post("/api/courses", (req, res) => {
        
        const name = { name: req.body.name };

        const schema = Joi.object({ name: Joi.string().min(3).required() });

        const result = schema.validate(name);

        if (result.error) {

          res.status(400).send(result.error.details[0].message);

        }

```

And the rest would be the same

---

_[View the full topic](https://forum.codewithmosh.com/t/joi-version-17/992)._
