-
Notifications
You must be signed in to change notification settings - Fork 401
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
Regression - OpenAPIGen breaks with String output examples #2789
Comments
If I add an explicit val endpoint = Endpoint(Method.GET / "simple/api/v1.0")
.outCodec[String](HttpCodec.content(MediaType.text.plain))
.examplesOut("a" -> "hello", "b" -> "world") |
I can only assume one default value for the MediaType. And that is Json. We support text plain and protobuf by default as well. But OpenAPI picks Json first. You have to support the explicit MediaType, if you want to only support that one type. |
That sounds sensible - but as you say - even if the MediaType is application/json those examples should be valid - and in fact they are handled without error up until the breaking commit. |
I have the same issue with a scala 3 enum return value. It worked before RC7, but now it causes a similar exception:
It looks like the example value gets wrapped in a |
I think it's this change that's causing the error: |
/bounty $75 |
💎 $75 bounty • ZIOSteps to solve:
Thank you for contributing to zio/zio-http! Add a bounty • Share on socials
|
It breaks my endpoint with an example, even if the output is JSON. The test fixtures are missing |
💡 @987Nabil submitted a pull request that claims the bounty. You can visit your bounty board to reward. |
🎉🎈 @987Nabil has been awarded $75! 🎈🎊 |
Describe the bug
A recent PR #2714 seems to have broken OpenAPIGen when providing output examples for simple String output.
To Reproduce
Expected behaviour
This seems to be a regression - it worked before and I would expect it to work.
Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: