You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating types from schemas having "type": ["object", "null"], the null part is not accounted for: I expected that a union type <object type> | null would be generated, as is the case for scalar types
Would you be able to create a reproducible example? I had a look at this yesterday and we have a type with array containing object and null in tests and it generates the expected result, so I wasn't able to reproduce
I just realized the issue was I am not using the latest version of openapi-ts, still on v0.42. Upgrading to v0.46 makes it all work as expected. Sorry, I'm closing this, apologies for wasting your time!
Description
When generating types from schemas having
"type": ["object", "null"]
, thenull
part is not accounted for: I expected that a union type<object type> | null
would be generated, as is the case for scalar typesOpenAPI specification (optional)
Configuration
openapi-ts -i openapi.json -o src/api
System information (optional)
pnpm v9.1.2
node v20.11.0
The text was updated successfully, but these errors were encountered: