-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Add nullable support on schema #204
Conversation
Hi @carlosrpg. I'm sorry but this is already fixed for version 2: https://github.com/asyncapi/asyncapi/blob/master/versions/next/schema.json#L337. Version 1.x is closed and not accepting changes anymore. We'll soon release version 2.0.0 with this and many more changes: https://github.com/asyncapi/asyncapi/pull/188/files. |
I can understand that but I imagined the 1.2 should be maintained for a while, specially since 2.0 spec differs so much from the previous one. |
I'm sorry but right now we can't maintain older versions with the resources we have. It's me working full time on AsyncAPI and a bunch of other people making occasional contributions. Can't you just use an extension like this? x-nullable: true Then it's just a matter of adding support for this extension in the existing tooling. |
Hey @carlosrpg , @fmvilas & friends, As it happens, I've just been doing a deep dive into questions and problems around
This is still being hammered out in OpenAPI, but a suggestion has been made to deprecate You might want to take a look at these issues: |
I'm going just to share my user scenario. |
BTW, I've always imagined nullable = true as oneOf { string with default "null" or other object } but I guess I've never put much thought on it. |
Thanks, @tedepstein! That helps a lot. @carlosrpg In version 2.0.0, nullable will be there because we want to keep compatibility with OpenAPI. That said, most probably the way to do that will be specifying that your schema type is OpenAPI/AsyncAPI 1.x (as we'll support multiple schema types) and the default schema type will be JSON Schema Draft 07. OpenAPI — AsyncAPI interoperability (regarding schemas) is one of the things we want to keep maintaining to support scenarios like the one you just described. I just ask for patience. We're going to release it soon. Tooling will be updated accordingly and we'll offer a migration script. In the meantime, please explore solutions using extensions like the one I described above. |
That is great to hear! having a tool to upgrade it will be awesome! |
It will be updated. Actually, this is what I'm working on right now. |
@fmvilas do we support nullable in version 2.0.0? |
There have been some further developments in OpenAPI. Here is the plan, as of now:
|
We don't support |
Thanks for clarification @tedepstein @fmvilas 👍 |
fixes issue asyncapi/generator#33
Ideally I would also add the html changes to display to the user the field is nullable but I don't have the time now