title: How to pass a tuple to JSON/Swagger in python?
body: <p>I am reading the meta-data of an image from a server and want to present it in a JSON dict or swagger format, not in a tuple or list.</p>
  <p>Here is my <strong>code</strong>:</p>
  <pre><code>app = Flask(__name__)
  app.secret_key = 'TOO_SECRET_TO_REVEAL'
  app.config['JSONIFY_PRETTYPRINT_REGULAR'] = True
  y = None
  
  @app.route(&quot;/&quot;)
  def login():
      return render_template('index.html')
  
  @app.route(&quot;/login&quot;, methods=[&quot;POST&quot;, &quot;GET&quot;])
  def connect():
      username = request.form.get('email')
      password = request.form.get('password')
      HOST='195.90.200.163'
      y = establish_connection(HOST, username, password)
      user = y.getUser().getName()
      user_id = y.getUser().getId()
      user_full_name = y.getUser().getFullName()
  
      #userid = y.getUser().getId()
      img_ids = []
      for image in y.getObjects(&quot;Image&quot;, opts={'owner': user_id}):
          img_ids.append(image.getId())
      
      for i in img_ids:
          img = y.getObject(&quot;Image&quot;, I)
          meta = img.loadOriginalMetadata()
          print(type(meta)) # the type is tuple
  
          data = json.dumps(meta, indent=4)
  
          #json_retrived = jsonify(data)
          python_obj = json.loads(data)
  
  
  
       return render_template('login.html', user=user, user_id=user_id, user_full_name=user_full_name, data=python_obj)
                              #data=json.dumps(meta, indent=4))
  
  def establish_connection(hostname, username, password):
      conn = BlitzGateway(username, password,
                      host=hostname, port=4064, secure=True)
      conn.connect()
      #conn.c.enableKeepAlive(60)
      return conn
  
  
  
  
  if __name__ == &quot;__main__&quot;:
      app.run(debug=True)
      app.run()
  </code></pre>
  <p>** What I get is just a list**
  <a href="https://i.stack.imgur.com/BtUWD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BtUWD.png" alt="enter image description here" /></a></p>
  <p>I want to show it in a JSON/Swagger structure but I am new to this approach, could you help me.</p>