-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[BUG][typescript-angular] oneOf and anyOf generates incorrect model for primitive types #4130
Comments
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
This actually happened another time.... // ... schema
schema: {
oneOf: [
{ type: 'integer', format: 'int32' },
{ type: 'string' }
]
} And the generated SDK imports something like this: import {string | number} from 'models/models'; |
@HighSoftWare96 would you like to give it a try and find a fix for this? |
I don't know even where I should start... Maybe someone more competent about this can try |
It's still not working for typescript-angular generator 🤔 Is this a general issue related to the generator?
|
Description
Using
oneOf
oranyOf
will generate a model with incorrect imports and wrong types.Number
is incorrect. It'snumber
and it should not be imported.integer
is incorrect. It'snumber
and should be merged withnumber
. It should not be imported.array
is incorrect. It'sArray<T>
orT[]
. So in this example it should have beenArray<string>
orstring[]
. It should not be imported.The expected model is:
openapi-generator version
openapi-generator v4.1.3
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Generate a typescript client using the above yaml.
Related issues/PRs
There appears to be a lot of issues related to
oneOf
andanyOf
. But couldn't find any specifically about this.The text was updated successfully, but these errors were encountered: