Skip to content
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

Generating a array union when using anyOf #287

Open
rushi444 opened this issue Apr 16, 2024 · 1 comment · May be fixed by #315
Open

Generating a array union when using anyOf #287

rushi444 opened this issue Apr 16, 2024 · 1 comment · May be fixed by #315

Comments

@rushi444
Copy link

I'm having trouble getting the right types when running the codegen.

I have some fields in my openapi.yaml that look like this:

        cover_photo_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Cover Photo Url

And the outputted type is looking like this:

cover_photo_url?: ((string | null) | Array<string | null>) | undefined

Is this expected behavior? Is there a workaround to not have Array<string | null> in the output
Or is this something wrong with the way the openapi spec is? This would be out of my control as I'm not responsible for that, thanks!

@clifton
Copy link

clifton commented Nov 20, 2024

i also have this issue

@clifton clifton linked a pull request Nov 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants