Ajv JSON schema validation

Veröffentlicht am: 19 Juli 2021
auf dem Kanal: Jan Goebel
20,749
402

🔥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/


Auf dieser Seite können Sie das Online-Video Ajv JSON schema validation mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Jan Goebel 19 Juli 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 20,749 Mal angesehen und es wurde von 402 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!