Skip to content

Zod validation | Runtime validation overhaul #313

Description

@ethanszeto

Task Necessity

  • Extremely - we've been really inconsistent with how we validate ANY input into the api at the controller level. We've tried certainly libraries in the past like JSON Schema, and even migrating to Fastify (which comes with a native schema validator) instead of Express. We even tried developing our own validation schema at one point. All of this is to say that we should transition to a more widely adopted runtime validator for api inputs, Zod.

Task Description / Solution Requirements

  • Your task is to clean up any remaining validation work from the past, and replace it with new Zod implementations at the controller level.
  • Every input from every request body should be validated (no need to worry about req params or query params)
  • All validation should be specific to that endpoint consuming it (no more repeated/shared schemas -- it just causes too much confusion)

Authorizations (if applicable)

  • N/A

Test Requirements

  • API tests should still work as intended

Additional Notes

  • This is a relatively large project. You should definitely use AI to resolve this faster, but please do check that everything maintains consistency (typing, naming, etc), since AI is particularly bad at that.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

+ -Changes to the codebasebeRequires backend work

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions