User input can be dangerous. You already know you need to validate any data your Express API receives. Without it, your API could crash horribly when it receives badly formatted data. You might end up with an unmaintainable database full of junk data.
Skipping out on validation leaves you vulnerable. Without it you could end up leaking sensitive user data. Or worse, you could lose control of your servers and be held to ransom by malicious attackers.
You want to avoid all these potential headaches. You sit down with Express and try and put in place all the things you need for a great API validation solution:
It seems simple at first, but you quickly end up overwhelmed. You get stuck trying to choose from a whole heap of different validation libraries. You're not sure how to properly integrate the library you've picked with Express. But wait, you also need to figure out what to do with validation errors... and then you need to invent your own error response format too?!
To make it worse, you can't seem to find any API validation best practices for the Express framework. What you have works, but it's clumsy. You're worried that you're doing it the wrong way.
What if you had a go-to validation library? A library which you trusted and could integrate into your Express APIs with ease.
Wouldn't it be amazing if you knew how to send awesome, standardized error responses?
You could confidently apply validation best practices to every Express API you create. You would be able to focus your time on building features. You would have validation taken care of.
Implementing validation in Express APIs takes up way more of your time than it should.
Learn the essentials of Express API validation with my book. With it you'll gain a deep understanding of "the Express way" for validation. Learn how to validate requests and send back awesome error responses with ease. Discover the power of the JSON Schema and Problem Details specifications. Then use them to help you conquer validation in Express.
View the full table of contents
Learn a complete API validation strategy you can start applying today.
Take care of validation in your Express APIs once and for all and buy my book. You'll be fearlessly validating requests in no time!
"A complex topic condensed into a well thought-out guide. The research has been done for me and I get to follow along. All design decisions are explained to aid with understanding. Brilliant!"
Senior Developer, Financial Times
"Concise and a pleasure to read. This book has clarified concepts for me that I couldn't get right even after years of consulting the Express documentation."
Lead Engineer, Tellimer