Skip to content

Validate request bodies with Zod #10

Description

@iexwr

Context

Endpoints accept JSON but do not validate shape, so bad input reaches Prisma/Stellar calls and produces vague 500s.

Acceptance criteria

  • Add Zod schemas for webhook payloads and any future write endpoints.
  • Invalid input returns 400 with a field-level error message.
  • Apply via a small middleware or inline schema.parse.

Technical notes

  • Add schemas in src/validate.ts using the existing zod dependency.

Testing

  • Test that malformed bodies return 400 with details.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions