0

We implemented a Python based REST service, which specifies the endpoints via Swagger. On the client side, we use the bravado library. This combination works fine for all but one endpoint. That endpoint has to return a large data set, which cannot be hold in memory and has to be streamed out. I want to send one record at a time and per line, as described here. According to the specification it should be possible to use "file" as a data type, but I could not find examples for input file (i.e. file uploads) and none for downloading files.

Any hint how to specify streamed output via Swagger and how to retrieve it via the bravado client?

Achim
  • 15,415
  • 15
  • 80
  • 144

1 Answers1

0

There was a bug in the Swagger schema, as you can find here: https://github.com/OAI/OpenAPI-Specification/issues/260 The library I used was still using the old schema. And update solved the problem. The bravado client tries to load the whole data into memory, which makes it unusable for my use case, but in general it works, if you use the latest schema and if your data fits into memory.

Achim
  • 15,415
  • 15
  • 80
  • 144