Skip to content

Add zod for data validation for forms and for working with external APIs #432

@acouch

Description

@acouch

Describe the problem and the solution you'd like

This is related to #415 . Zod is pretty standard for data validation for forms and for validating data from external APIs. Using zod to create schemas and using z.infer to create types from those is a nice pattern to use for data handling and complements the fetch handling developed on grants.gov.

The CMS-RASS challenge repo provides an example: https://github.com/navapbc/bid-fed-cms-rass-tech-challenge/tree/main/rass-web/src

lib/fetch // for fetch handling and error throwing
services/fetch // for adding individual API endpoints
schemas // for zod schemas
types/api // for types inferred from zod schemas

Alternatively we could adopt a library like orpc that handles the same functionality or standardize on a project like orval so are are adopting a more standard set of conventions.

Additional context

No response

Priority

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or requesttriageNew issue which needs reviewed by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions