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

Update json-shema-to-zod to 2.1.0 #2464

Merged
merged 4 commits into from
May 1, 2024
Merged

Update json-shema-to-zod to 2.1.0 #2464

merged 4 commits into from
May 1, 2024

Conversation

lukesonnet
Copy link
Contributor

@lukesonnet lukesonnet commented May 1, 2024

Updates json-schema-to-zod so that we can properly use exclusiveMinimum and because the version we used was super old.

Had one main side effect that I can tell (besides adding a bunch of whitespace):

Before, format: date on a string field and format: date-time didn't do anything as the json schema to vod package skipped it. It produced in z.string(). Now, it produced z.string().date() or something similar for date-time. Because we don't have any true dates but those fields are actually datetime, I changed the yaml to match the right datatype. However, now we are validating these inputs as date-time and this could break user flows that previously worked (e.g. passing epoch time as a string).

Copy link

github-actions bot commented May 1, 2024

Your preview environment pr-2464-bttf has been deployed.

Preview environment endpoints are available at:

Copy link

github-actions bot commented May 1, 2024

Deploy preview for docs ready!

✅ Preview
https://docs-14v4aehnl-growthbook.vercel.app

Built with commit 8032c9e.
This pull request is being automatically deployed with vercel-action

@lukesonnet lukesonnet changed the title Update zod and json-to-zod Update json-shema-to-zod to 2.1.0 May 1, 2024
Copy link
Collaborator

@bttf bttf left a comment

Choose a reason for hiding this comment

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

Since we're already using date-time in most places, this seems fine and necessary to correct. It might break for some users but have to rip the bandaid at some point.

@lukesonnet lukesonnet merged commit 37a6b10 into main May 1, 2024
5 checks passed
@lukesonnet lukesonnet deleted the ls/openapi-zod branch May 1, 2024 23:03
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.

None yet

2 participants