-
Notifications
You must be signed in to change notification settings - Fork 52
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
How to specify the return type for an API that writes to the output directly via stream #81
Comments
I ran into this problem today and it doesn't look possible with tonic. https://github.com/loopfz/gadgeto/blob/ecd126f80b95fae7372be52e0e0f119d4e46f5d2/tonic/handler.go#L37-L65 |
The media type of the operations' response is defined by the media type that Tonic uses to encode responses, and it is limited to It think we should allow to override the media type per operation for the response using a Does any one of you wish to send a PR ? Otherwise I'll look into it when I have the time. |
I did it in loopfz/gadgeto#87 a while ago on Tonic, and mcorbin@1b8b7d7 on Fizz to generate the proper OpenAPI doc based on routes media types. |
@mcorbin Reviewed the PR on tonic, waiting for another approval/check. Once its ok, send the PR on fizz to close this issue, and I'll review it. |
Thank you @wI2L . There is a lot of interesting MR on Tonic which should be interesting to merge (for now I forked both repositories and merged everything on my side). |
Hi,
We're returning a large ndjson stream on some calls, and the problem we have is that we can't figure out how to get fizz go generate an openapi spec that indicates that ndjson is returned as the output, so instead the spec indicates nothing is returned.
We're essentially writing x-ndjson directly to the Writer on the context.
We tried using a fizz.Response(200...) but we can't override that.
The text was updated successfully, but these errors were encountered: