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

Develop 2.0 - support binary input and output #1335

Merged
merged 9 commits into from
Aug 7, 2015

Conversation

boazsapir
Copy link

This replaces #1166 with a new implementation based on the conclusions of the discussion in OAI/OpenAPI-Specification#50

These changes in swagger-model are a precondition to the changes that are needed in swagger-codegen in order to support binary input and output. Once this request is merged, it will be followed by another pull request to swagger-codegen.

@BigSocial
Copy link

I guess this solves my issue #1531 assuming core will map the InputStream parameter (see my example) to "type" : "string", "format" : "byte" and codegen and UI understand the same thing.

I'd make a few points:

  1. "type" : "string", "format" : "byte" is a confusing way to encode this. "type" : "binary" seems much more clear but I guess there are reasons...
  2. @webron asked in Clarify 'byte' format OAI/OpenAPI-Specification#50 "Do you think that, in the case of "format" : "binary", the content type "octet-stream" should be mandatory?" I believe the answer is very much "no" since there are any number of MIME types that one might want to deal with this way e.g. all the image types, application/pdf, application/msword, etc.
  3. Every popular object storage REST API including S3, OpenStack, Box, DropBox, etc. require PUT or POST of binary data with no encoding to upload objects. I point this out to make it clear that this is not a fringe use case for anyone dealing with binary files such as images, documents, presentations, etc.

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 this pull request may close these issues.

3 participants