-
-
Notifications
You must be signed in to change notification settings - Fork 592
fix(openapi-typescript): handle nullable schemas #2059
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(openapi-typescript): handle nullable schemas #2059
Conversation
🦋 Changeset detectedLatest commit: 234bceb The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
581e476 to
4339d72
Compare
|
Hello @drwpow , Once we resolve that I'll finalize the PR |
That’s my understanding. If you look at the OpenAPI 3.1 specification, you’ll often see typings like this: |
4339d72 to
234bceb
Compare
✅ Deploy Preview for openapi-ts ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Great tests, and great fix! Replied to the comment about $ref handling, but let’s merge & release the rest of it as-is
* fix(openapi-typescript): handle nullable schemas * chore(examples): regenerate after nullable handling fix
Changes
Allow all types except UNKNOWN to be nullable.
Fixes #1821 and #1940 .
How to Review
I re-applied #1959 (it didn't move for a while)
I added tests for the new syntax for OAS 3.1 (not the one with
oneOf, but with atypearray, as documented here).Checklist
docs/updated (if necessary)pnpm run update:examplesrun (only applicable for openapi-typescript)