flasgger / flasgger

Easy OpenAPI specs and Swagger UI for your Flask API

Home Page:http://flasgger.pythonanywhere.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Help with response visualization

andriilitvynchuk opened this issue · comments

Hi! For my POST method I have the response as JSON with 2 fields: depth and depth_refined, both are base64 encoded images. Precisely, I form it like that:

return jsonify(
        {
            "depth": str(depth_base64),
            "depth_refined": str(depth_refined_base64),
            "status": 200,
        }
    )

How can I visualize those images in swagger UI for Try it out feature? This doesn't work for me:

responses:
 "200":
   description: Successful response
   schema:
     properties:
       depth:
         type: string
         format: base64
         description: Base64-encoded depth map
       depth_refined:
         type: string
         format: base64
         description: Base64-encoded refined depth map

I just get json output (literally, bytes) In Response Body field