Skip to content

nullable data returning as unkown #2005

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

Closed
johnyvelho opened this issue May 3, 2025 · 2 comments
Closed

nullable data returning as unkown #2005

johnyvelho opened this issue May 3, 2025 · 2 comments
Labels
bug 🔥 Something isn't working

Comments

@johnyvelho
Copy link

johnyvelho commented May 3, 2025

Description

I have a return type that can be nullable, but I am getting unknown instead:

Image

The documentation was generated correctly:

Image

spec json:
openapi.json

Reproducible example or configuration

No response

OpenAPI specification (optional)

openapi.json

System information (optional)

No response

@johnyvelho johnyvelho added the bug 🔥 Something isn't working label May 3, 2025
@mrlubos
Copy link
Member

mrlubos commented May 3, 2025

Which documentation tool are you using? I think they took a liberty in supporting null type but that's not supported by OpenAPI 3.0. If you upgrade your spec to 3.1, it will generate as expected

@johnyvelho
Copy link
Author

Gotcha! So it’s not a bug after all. Sorry about that.

I am using elysiajs, with @elysiajs/swagger plugin. there is no way to set the openapi version to 3.1 for now (its hard coded). but there is a PR opened for that: elysiajs/elysia-swagger#195.

I've changed it manually and it worked as expected. so lets wait for this PR to get approved

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🔥 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants