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

jsonResponse should be a Zod schema #78

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

codetheweb
Copy link
Contributor

withRouteSpec() previously didn't error if jsonResponse was a plain JS object.

`withRouteSpec()` previously didn't error if `jsonResponse` was a plain JS object.
methods: ["POST"],
auth: "auth_token",
jsonBody,
jsonResponse: z.object({
ok: z.string(),
}),
})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this usage is generally allowed but we weren't testing for it before

@codetheweb codetheweb marked this pull request as ready for review July 6, 2023 21:05
@codetheweb codetheweb merged commit 0feab1d into main Jul 6, 2023
1 check passed
@codetheweb codetheweb deleted the fix-json-response-must-be-zod-schema branch July 6, 2023 21:54
github-actions bot pushed a commit that referenced this pull request Jul 6, 2023
# [2.0.0](v1.4.1...v2.0.0) (2023-07-06)

### Features

* Merge pull request [#78](#78) from seamapi/fix-json-response-must-be-zod-schema ([0feab1d](0feab1d))

### BREAKING CHANGES

* existing `jsonResponse` fields may need to be wrapped with `z.object()`
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

Successfully merging this pull request may close these issues.

2 participants