-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
Producing an unknown[]
type for an array field with items
set to a type
#726
Comments
unknown[]
type for an array field with items
set to a $refunknown[]
type for an array field with items
set to a type
@anymaniax I just noticed that this is actually also happening for a json schema array whose
causes orval to produce a |
same here |
Can you confirm this is still happening with 6.20.0 ? |
unknown[]
type for an array field with items
set to a typeunknown[]
type for an array field with items
set to a type
It's not happening for us anymore... However our schema has changed a lot since and as no reproduction repository was made, you can close this issue until further notice. |
What are the steps to reproduce this issue?
npm install
thennpm run orval
Client.ts
file produced has anunknown[]
type, which is unexpected: https://github.com/lmossman/orval-example/blob/c460c310267f03311e00dda5a2f1394c2db4a839/src/client/Client.ts#L25What happens?
The
fields
field has its type set tounknown[]
What were you expecting to happen?
The type of
fields
should beAddedFieldDefinition[]
instead ofunknown[]
Any logs, error output, etc?
It doesn't seem related, but this is printed out for the repro instructions I listed above. These same logs aren't printed out for my production repo though, so my guess is these are coming from me trying to just pull a sample of the schema out for the example
Any other comments?
My guess is that orval has trouble with an array field when
items
is set to a$ref
- it seems like it loses the type when that happens and defaults to setting the type of the array tounknown
What versions are you using?
Operating System: macOS 12.5
Package Version: 6.11.0
Browser Version: Chrome 108.0.5359.124
The text was updated successfully, but these errors were encountered: