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

Treat oneOf(a, null) as optional #70

Open
cbndr opened this issue Mar 29, 2020 · 0 comments · May be fixed by #84
Open

Treat oneOf(a, null) as optional #70

cbndr opened this issue Mar 29, 2020 · 0 comments · May be fixed by #84

Comments

@cbndr
Copy link

cbndr commented Mar 29, 2020

Would it be possible to treat a oneOf of 2 types where one is null as optional? Example:

          "oneOf": [
            {
              "type": "integer",
              "format": "int32"
            },
            {
              "type": "null"
            }
          ]

currently generates an interface{} type in Go. IMO it would be preferable to generate a *int instead. I know this could be coded differently in JSON schema to generate the desired output, but unfortunately, the schema is not under our control.

@lustefaniak lustefaniak linked a pull request Feb 2, 2022 that will close this issue
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 a pull request may close this issue.

1 participant