redoc icon indicating copy to clipboard operation
redoc copied to clipboard

prefixItems isn’t respected

Open brookjordan opened this issue 4 years ago • 2 comments

Describe the bug

Defining prefixItems within an array with items set to false displays a message saying: Schema not provided.

Expected behavior

Defining prefixItems as an array with items set to false should outline that this is an array containing only the items in prefixItems. Using anyOf/oneOf as the items array gets us a little closer, but doesn’t enforce the order of the items.

This makes it look like the swagger document itself is incorrect. If support of this is out of scope, could we at least change the text to something like “prefixItems is not yet supported”?

Minimal reproducible OpenAPI snippet(if possible)

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

Screenshots

items: false

This gives text that blames the author of the swagger document: Screenshot 2021-11-15 at 5 47 14 PM

items:
  anyOf:
    - type: number
    - type: string

Using anyOf or oneOf makes it look like the array can be 2 of either numbers or strings: Screenshot 2021-11-15 at 5 40 18 PM

brookjordan avatar Nov 15 '21 09:11 brookjordan

prefixItems is not supported ATM. We'll add it to our list.

RomanHotsiy avatar Nov 16 '21 06:11 RomanHotsiy

this is fixed.

Image

Image

/close cc @Oprysk @AlexVarchuk

jeremyfiel avatar Apr 08 '25 15:04 jeremyfiel