#joi #validation #javascript
In this video, I'll show you how to create a conditional validation schema with Joi for NodeJS. Very useful for validating requests coming into your API! Conditional validation allows you to change the validation rules for one property, based on the value of another. Really cool!
Joi is a really great library for validating objects in JavaScript, I use it in every Node project - go check it out!
Joi Github:
https://github.com/sideway/joi
Joi documentation:
https://joi.dev/api/
I'm Chris Roberts, a freelance software engineer based in the UK:
https://chrismroberts.com/
Follow me on Twitter:
/ chrismrobertsuk
Our gear - click through to support our channel! :)
Camera (Canon M50)
UK: https://amzn.to/3sUbzuL
US: https://amzn.to/3uBsG5c
Camera mic (RODE VideoMic Pro)
UK: https://amzn.to/3ml8xgC
US: https://amzn.to/2RkGxyi
Camera tripod (Manfrotto Compact tripod):
UK: https://amzn.to/3fJGyWU
US: https://amzn.to/3mF4oV2
Voiceover Mic (Blue Yeti)
UK: https://amzn.to/2PV7UOQ
US: https://amzn.to/3uMiEym
Chris's dev mouse for PC (Logitech MX Master 3)
UK: https://amzn.to/39K7BNV
US: https://amzn.to/3uKYvso
Chris's dev keyboard for PC (Logitech MX Keys)
UK: https://amzn.to/3rSbHcX
US: https://amzn.to/3a6Unef
Rob's dev keyboard for Mac (Apple Magic Keyboard)
UK: https://amzn.to/3dEQpKG
US: https://amzn.to/3sb6JZc
Rob's dev mouse for Mac (Apple Magic Mouse)
UK: https://amzn.to/3sRCQhr
US: https://amzn.to/3mFi6qS