Skip to content

Treat oneOf(a, null) as optional #70

@ghost

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions