-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Improve binary data definitions #430
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
Comments
As mentioned here: swagger-api/swagger-core#1531 (comment) I would like the spec to support a binary format which would indicate that it needs to be streamed. I believe a lot of APIs performing file upload and download would benefit from this as the current I reproduce here my proposal for an additional Data Types
The generators would then use an appropriate data type (ex: The name |
Well, I'll copy my comment too ;) Not sure the spec should deal with how things are handled but rather what they are. To me, in your case, |
Sorry for the cross-posting, I looked around a lot in the issues to find problems similar to what I was having. I'll continue the discussion here only. I understand your point and I agree that the spec should document the data type and not the implementation details in general. However, this specific problem is quite common and one could argue that binary data that cannot be handled in memory is different from binary data that can. But the real issue is that any API for large file download cannot be represented optimally using swagger. What I mean is that if I specify |
No worries about the cross posting and happy to see you moved the discussion to the right place. Thanks for providing the additional details, they should be taken into account. Question is - can we really tell the clients what's 'too big' for the to handle? I get the need to hint them about it, we just need to be careful about how we end up documenting it. |
Actually, if there are two data types, the API designers will have to make this decision based on their knowledge of what the API is used for. I agree with you that if such a type was introduced, the spec would need to be clear about the difference and when to use In the limit, all binary data could be streamed. Then we would not need To me, |
So it looks like we're in sync in terms of the challenges here. If you have any additional thoughts, those would be welcome. Hopefully, over time, more people would voice their opinion as well. |
Tackling PR: #741 |
This was handled in #878. |
Related #3024 |
Following the discussion in #50, for the next version of the spec we should provide a better way of defining transfer of binary data. This should also include support for multiple file upload (#254) and supporting file transfer using other mime types (#326).
The text was updated successfully, but these errors were encountered: