BuildForSDG / Team-006-Backend

MIT License
2 stars 4 forks source link

[feature] - Create validation middleware and initial validation rules #20

Open dave-ok opened 4 years ago

dave-ok commented 4 years ago

Description

Create an express middleware for validation of all input data to API endpoints using the hapi/joi validation package. Create a directory (or a file if not too large) containing various validation rules for existing models (note: more rules will be added over time).

Resources

https://dev.to/jacqueline/using-hapi-joi-version-16-1-7-to-validate-a-request-body-in-a-restful-api-bje

Acceptance Criteria

ifeLight commented 4 years ago

We can create a folder for every validation needed, and we need to know the fields that need to be validated, how are we going to set that

dave-ok commented 4 years ago

Sorry @ifeLight this message was lost in a ton of mail I got yesterday. The existing models will be a good place to start