Skip to content

Converting 3.0 -> 3.1: nullable not converted in anyOf or oneOf #172

@sam-super

Description

@sam-super

E.g.

foo:
  oneOf:
    - title: bar
      $ref: '#/components/schemas/Bar'
    - title: baz
      $ref: '#/components/schemas/Baz'
  nullable: true

I think should covert to:

foo:
  oneOf:
    - title: bar
      $ref: '#/components/schemas/Bar'
    - title: baz
      $ref: '#/components/schemas/Baz'
    - type: 'null'

I can see from convertNullable it's looking for the type prop and doesn't look at oneOf or anyOf.

I will get a PR together but please let me know if i'm making an incorrect assumption above.

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