-
-
Notifications
You must be signed in to change notification settings - Fork 532
Support nullable as type arrays for OpenAPI 3.1 #898
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
Comments
I think there are 2 things here worth addressing: 1. This feels like a good change that should happen for both 3.0 and 3.1I think the 2. This library should probably distinguish between 3.0 and 3.1This doesn’t block the previous solution from happening, but it may be needed in the future. Extra infoThere is an internal version number that gets passed around for the parts of the codegen where Swagger 2.x differs from OpenAPI 3.x. But where OpenAPI 3.0 differs from 3.1, this library could do better. I think this wouldn’t be a major change—probably just switching that internal Sidenote: previous versions of this library did have more of a separation between 2.x and 3.x schemas, but all-in-all they share so much in common that it was easier to maintain one codebase and hard-code in the deviations rather than maintain 2 completely-isolated generators Anyways, would love if someone could open a PR to address this! |
In OpenAPI v3.1
nullable: true
was removed in favor of type arrays with the value"null"
. Reference: https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0The current version of openapi-typescript generates those properties as
unknown
, instead ofstring | null
.The text was updated successfully, but these errors were encountered: