I use a swagger file and ##class(%REST.API).CreateApplication to create the rest api.
There is an interesting post: https://community.intersystems.com/post/download-file-rest-api-operation, but it is code, not a swagger configuration. disp.cls returns always a header content : application/json that of course fails as I am not always returning a json
I can not figure out what to put in swagger. Some examples I tried: