🔥More exclusive content: https://productioncoder.com/you-decid...
Twitter: / _jgoebel
Website: https://jangoebel.com
Blog: https://productioncoder.com
Code: https://github.com/productioncoder/aj...
Ajv.js: https://ajv.js.org
JSON schema: https://json-schema.org/
00:00 introduction to Ajv JSON schema validation
00:50 Ajv example project walkthrough
02:20 install ajv and ajv-formats
03:35 creating and configuring Ajv instance
05:18 creating a custom Ajv JSON schema
08:11 creating an Ajv schema validation middleware
09:56 Ajv errors: preserving the reference
12:13 making use of Ajv validator in express
12:50 testing Ajv validation with Postman
14:11 conclusion
In this video we cover how to perform JSON validation with Ajv. We use Ajv to validate incoming request payloads and to return a bad request error in case we are missing certain fields or in case certain fields are not formatted correctly.
We talk about how to set up Ajv with express and we create a custom Ajv schema which we can plug into our express middleware. The Node.js Ajv validator is probably one of the most promising request body validation approaches out there because it makes use of the standardized cross-plattform JSON schema RFC: https://json-schema.org/
In questa pagina del sito puoi guardare il video online Ajv JSON schema validation della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Jan Goebel 19 luglio 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 20,749 volte e gli è piaciuto 402 spettatori. Buona visione!