Skip to content

Nullable array with $ref is generated as any[] | null #991

Open
@clemeth

Description

@clemeth

I have an object with the following (non-required) property defined in the schema (OpenAPI 3.1.0):

"foos": {
  "type": ["array", "null"],
  "items": {
    "$ref": "#/components/schemas/Foo"
  }
}

On 13.0.22, this generates: foos?: any[] | null

I would instead expect: foos?: Foo[] | null

The same thing happens if the property is required, as well. If I make it non-nullable, it works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions