How can i use requestBody to upload an image as binary in phoenix/Elixir

Zubair Nabi

So far i have been using

    swagger_path :create_tag do
    post "/tag"
    produces "application/json"
    description "register Tags"
    consumes "multipart/form-data"        
    parameters do 
    image :formData, :file,  "The file to upload.", required: true
    end
    response 200, "Success"
end

However i would like to use requestBody to get the binary data of the image, with above i am getting the image path, and have to work on Plug.Upload in controller.

would like to know the syntax using the requestBody of swagger in phoenix

Mike Buhot

Binary file uploads are not supported in the swagger 2.0 spec used in phoenix_swagger:

Uploads where the payload is just the raw file contents are not supported in Swagger 2.0, because they are not multipart/form-data. That is, Swagger 2.0 does not support something like:

curl --upload-file archive.zip http://example.com/upload

The open_api_spex package targets swagger 3.0, which supports binary requestBody operations.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I upload image and data in the same request with angular and resteasy?

How can I show an image in sweet alert that I want to upload?

How can I find endpoints of binary skeleton image in OpenCV?

How can i upload image with ajax in codeigniter?

How can I write a binary array as an image in Python?

Can I Use A Form Field To Rename An Upload Image File?

How can i transform my binary numpy list of arrays to an image?

How I can use WordPress Media Uploader with Multiple image upload Button

How can i upload image using glide from url path

How i can upload image to the article?

How can I dilate a binary image without closing holes with OpenCV

How can I find the line in a binary image?

How can I upload the image file with axios?

how can I send an image binary via post to an API? nodejs

How can i retrieve the image stored in binary format from database

how can i convert image to binary image using php?

How can I display binary image data as an Image in PHRETS

Can I upload binary packages to a Launchpad PPA?

How can I upload an image with AJAX?

How can i remove noise in this binary image and smooth the image -openCV

How can I upload image use ajax on the vue.js 2?

How can I fill gaps in a binary image in OpenCV?

How can I use two separted image upload preview?

How can I recolor shapes in a binary image for indexing (floodfill)?

How can I use seek() in a binary file?

How can I get cropped Image to upload ? | React

How can I use an image from a file upload in HTML as a background?

hi i use kendo upload to upload image how i can preview image when i upload it im using jquery

How can I read a binary file and turn that data into an rgb image?