-
-
Notifications
You must be signed in to change notification settings - Fork 272
Fix Valibot strictObject for additionalProperties: false #2945
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
Conversation
|
|
🦋 Changeset detectedLatest commit: 3786d2b 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 GitHub.
|
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2945 +/- ##
==========================================
+ Coverage 28.27% 28.42% +0.14%
==========================================
Files 389 394 +5
Lines 35223 35266 +43
Branches 1933 1934 +1
==========================================
+ Hits 9959 10024 +65
+ Misses 25237 25215 -22
Partials 27 27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
commit: |
When
additionalProperties: false, the generator producedv.objectWithRest({}, v.never()), creating unusable TypeScript types with[x: string]: undefinedindex signatures that conflict with actual properties.Changes
packages/openapi-ts/src/plugins/valibot/v1/toAst/object.tsto detectadditionalProperties.type === 'never'and emitv.strictObject()insteadadditionalProperties: falsein both simple and nested object schemasExample
Before:
After:
Objects with
additionalPropertiesas a schema (notfalse) continue usingv.objectWithRest()correctly.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.