Skip to content

--array-length with minItems: 1 generates empty array #2048

@OliverJAsh

Description

@OliverJAsh

Description

--array-length with minItems: 1 generates empty array.

Tested with v7.4.4 and v7.1.2.

Reproduction

Copy the example here: https://openapi-ts.dev/cli#arraylength

components:
  schemas:
    TupleType:
      type: array
      items:
        type: string
      minItems: 1
      maxItems: 2

Expected result

export interface components {
    schemas: {
        readonly TupleType: [string] | [string, string];
    };
}

Actual result

export interface components {
    schemas: {
        readonly TupleType: [
        ] | [
            string
        ];
    };
}

Checklist

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopenapi-tsRelevant to the openapi-typescript library

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions