Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add schema validation #159

Closed
anandbaburajan opened this issue Dec 23, 2020 · 1 comment
Closed

Add schema validation #159

anandbaburajan opened this issue Dec 23, 2020 · 1 comment

Comments

@anandbaburajan
Copy link
Owner

We need to have proper schema validation for cases like making sure the Poll choices are UNIX timestamps, the intervals are neither too small nor large, etc. Going with joi might be a good idea.

@anandbaburajan
Copy link
Owner Author

I looked more into this and here's what I learnt:

  1. Using joi for validation at the 'request' level won't be necessary since mongoose' built-in validators take care of the types and most of the validation would be done on the client - which is the primary consumer of our API. For example: for choices, we could check if a choice is greater than the current Unix timestamp but that won't be necessary since the client would take care of that anyway.
  2. Regarding intervals, the backend shouldn't have any constraints on the min & max intervals. There could be users who might want to have both 10 minute meets or 1 day hackathons. For the MVP, the client could let users choose a interval in a certain range like discussed here.

@anandbaburajan anandbaburajan transferred this issue from another repository Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant