-
-
Notifications
You must be signed in to change notification settings - Fork 528
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
anyOf combining literals and objects generates incorrect code #2034
Comments
@danikenan what is the type you'd expect? |
@danikenan we just merged a fix for similar issue in our fork, mind having a look if it fixes your problem too? |
@mrlubos Doesnt resolve it. The issue is that the tool resolves |
@kevinand11 I'll try to fix it this weekend |
@kevinand11 Please open a pull request with failing test case against our fork. The following spec "AnyOfConst": {
"anyOf": [
{
"const": "foo"
},
{
"$ref": "#/components/schemas/ModelWithString"
},
{
"$ref": "#/components/schemas/ModelWithArray"
}
]
} generates the following model export type AnyOfConst = ("foo" | ModelWithString | ModelWithArray); so I think this works as expected. |
@danikenan this is fixed in @nicolas-chaulet/openapi-typescript-codegen |
The following schema
produces the following:
The text was updated successfully, but these errors were encountered: