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

feat: add --x-nullable-as-nullable to treat schemas with x-nullable as being able to specify null #1576

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

mitchell-merry
Copy link
Contributor

@mitchell-merry mitchell-merry commented Mar 3, 2024

Changes

Essentially adds the nullable feature from 3.0 into 2.0 as well, behind the --x-nullable-as-nullable flag.

How to Review

Stacked on #1575!

Checklist

  • Unit tests updated
    Specifically didn't add too much so as not to over-test. This is not a commonly used version, anywho

Copy link

changeset-bot bot commented Mar 3, 2024

⚠️ No Changeset found

Latest commit: 9fa2708

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@drwpow
Copy link
Contributor

drwpow commented Mar 3, 2024

Thanks for adding this! I’m good with this addition. While I know 3.x encourages type: [null] as the recommended way, nullable: true and x-nullable: true are still really common patterns I see in 3.x schemas and I think supporting both doesn’t stand in the way of the 3.x specs while providing value to users. +1 to this landing.

@mitchell-merry
Copy link
Contributor Author

mitchell-merry commented Mar 3, 2024

Specifically, this is to support a 2.x schema, where I believe there is no official pattern for nullable (outside of this x-nullable thing) which is why I am PRing into 5.x 😄.

Thanks for the quick reviews, though!

@mitchell-merry mitchell-merry marked this pull request as ready for review March 3, 2024 21:14
@drwpow drwpow merged commit 77d92a3 into openapi-ts:5.x Mar 4, 2024
10 checks passed
@mitchell-merry
Copy link
Contributor Author

Thanks for the merge! Could we get a release of 5.x with this change?

@drwpow
Copy link
Contributor

drwpow commented Mar 4, 2024

Published!

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.

2 participants