Skip to content

Valiations

Anshuman Chhapolia edited this page Mar 23, 2024 · 1 revision

Validations

For validations I would suggest using class-validators library. It is a simple library that allows you to use decorators to validate your entities.

As for validation create seperate request classes that will be used to validate the incoming requests. This ensures there is no validation logic near the database layer and all the data that is being passed to the database is validated. This also helps in documenting the expected input for the API and works well the Documentation helpers from @smoke-trees/postgres-backend.

Clone this wiki locally