swagger-typescript-api icon indicating copy to clipboard operation
swagger-typescript-api copied to clipboard

prefixItems with the same minItems and maxItems value should generate tuples

Open brookjordan opened this issue 4 years ago • 0 comments

For example, if we want a list of lat, lon coordinates, this:

type: array
items:
  type: array
  minItems: 2
  maxItems: 2
  prefixItems:
    - number
    - number

should generate:

[number, number][];

rather than the current:

any[][]

For now the closest we seem to be able to get is:

type: array
items:
  type: array
  items:
    type: number

generating:

number[][]

brookjordan avatar Aug 05 '21 06:08 brookjordan