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

Reference object and nullable #145

Closed
kontsaki opened this issue Mar 26, 2024 · 1 comment
Closed

Reference object and nullable #145

kontsaki opened this issue Mar 26, 2024 · 1 comment
Labels
need more info Need more info to be able to fix it

Comments

@kontsaki
Copy link

kontsaki commented Mar 26, 2024

Hello,

according to OAI/OpenAPI-Specification#1368
the following schema generated by okapi

            "schema": {
              "$ref": "#/components/schemas/SomeType",
              "nullable": true
            }

should instead be

            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/SomeType"
                }
              ],
              "nullable": true
            }

with OpenAPI v3.1.0 completely dropping nullable in favor of the following

            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/SomeType"
                },
                {
                  "type": "null"
                }
              ]
            }

How does okapi want to handle this, if at all?

@ralpha
Copy link
Collaborator

ralpha commented Apr 28, 2024

Looking over the discussion you linked it looks like there is not a bit agreement over the issue. As Okapi is currently following the 3.0.0 spec I don't think this would be worth a fix at this point. When we are looking at implementing 3.1.0 (or later) this would automatically be fixed.
As it currently stand it looks like all the tools that use the OpenAPI spec already handle the current way of doing this correctly.

Unless you can show me an exact use-case where this is creating issue I'm not intending to spend time fixing this. If you provide me with more info I'm willing to have a closer look at this. But please provide me with concise information.
(Will close issue, can always reopen if more info is provided)

@ralpha ralpha closed this as not planned Won't fix, can't repro, duplicate, stale Apr 28, 2024
@ralpha ralpha added the need more info Need more info to be able to fix it label Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info Need more info to be able to fix it
Projects
None yet
Development

No branches or pull requests

2 participants