-
-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prefixItems is unsupported (OpenAPI 3.1) #890
Comments
Having the same issue, everywhere else my spec is valid. Can't find any info online for this specific issue either. |
I can confirm this issue. Using python and pydantic, defining a type with a tuple_positional_schema generates a prefixItems key. Changing the type's json schema to a List instead of a Tuple works as a temporary (less robust ) fix. |
I narrowed this error to a change in my swagger.json from this (works):
to this (raise the Error: All arrays must have an
And this is the code that generates this schema for me:
|
Any news on this? |
Just encountered the same error, as well as countless Is there any workaround so far? |
@Pierstoval I was able to fix it. My Swagger doc is auto-generated by NestJS Swagger. The problem was that arrays of a 'simple type' such as a number or a string didn't have a type in the Swagger JSON. So at first I had: @ApiProperty({ required: false, isArray: true })
@Expose()
numberArray?: number[]; Once I changed all those arrays to the following: @ApiProperty({ required: false, isArray: true, type: Number })
@Expose()
numberArray?: number[]; The schema added the correct type and it was instantly fixed. So all I had to do was add the correct |
I get the same error, would be very helpful if error was correlated with schema line number - that would help to narrow down the issue. |
What are the steps to reproduce this issue?
What happens?
Orval will crash saying
ovt - Error: All arrays must have an items key define
What were you expecting to happen?
Client will be generated
Any logs, error output, etc?
Swagger Example
Any other comments?
The text was updated successfully, but these errors were encountered: