javarestswaggerswagger-2.0

Swagger spec representation of blob


I am creating a swagger spec for a new endpoint that will be receiving a file as a binary data. How might you represent this in a swagger spec? I see object as a data type but that does not appear to be what I'm looking for. Has anyone done this in the past?

This question is not a duplicate as far as I can tell as it pertains specifically to a binary or "blob" object type.


Solution

  • Since swagger describes RESTful web services, any binary data will be base-64 encoded, turning it into a string. Therefore, the way to specify it is to just define it as such - a string.