-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
fix(plugins/zod): fix support for string types in binary format #1616
base: main
Are you sure you want to change the base?
Conversation
|
🦋 Changeset detectedLatest commit: f841028 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hi @nedpals, are you able to add tests please? |
@mrlubos overlooked it my bad. will add the tests once i get back online tomorrow |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1616 +/- ##
==========================================
- Coverage 56.26% 56.22% -0.05%
==========================================
Files 158 158
Lines 24875 24896 +21
Branches 1816 1816
==========================================
+ Hits 13997 13998 +1
- Misses 10868 10888 +20
Partials 10 10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
commit: |
@nedpals Actually I do have a question here. Since it's now no longer matching strings, won't this fail response validations? |
My use case for this is for form validation (react-hook-forms specifically) since I presume that the correct response types were already inferred during client generation. Another thing is that I also expect that it should match 1:1 with the generated Typescript types. |
This fixes support for string types in binary formats by converting the
stringExpression
into a Zod union type with File and Blob. It matches the behavior of @hey-api/typescript's handling of the said type.