-
-
Notifications
You must be signed in to change notification settings - Fork 528
Remove undefined from additionalProperties union #1799
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: 4e0f0cf 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 |
ef03c56
to
104bd62
Compare
Deploying openapi-ts with
|
Latest commit: |
4e0f0cf
|
Status: | ✅ Deploy successful! |
Preview URL: | https://7998dd1d.openapi-ts.pages.dev |
Branch Preview URL: | https://addl-properties-no-undef.openapi-ts.pages.dev |
817a603
to
ed1dcbf
Compare
@@ -46,7 +54,8 @@ describe("transformSchemaObject > object", () => { | |||
}, | |||
want: `{ | |||
property?: boolean; | |||
[key: string]: string | undefined; | |||
} & { | |||
[key: string]: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this intersection seems a little awkward, but is necessary for TypeScript to work properly in most cases (here, you’d get some error like “property string
not assignable to type boolean | undefined
”).
ec58bc9
to
747f69c
Compare
747f69c
to
4e0f0cf
Compare
Changes
Fixes #1732, #1737, and other related issues mentioning this behavior. Removes the
| undefined
from theadditionalProperties
union that is a behavior change from 6.x.How to Review
Checklist
docs/
updated (if necessary)pnpm run update:examples
run (only applicable for openapi-typescript)