In python flasgger, how to expand schema in web interface by default?

232 Views Asked by At

I have started to use Swagger for API documentation. Please help me configure it. How to expand the schema in Swagger UI by default?

from flasgger import Swagger, swag_from
from flask import Flask

app = Flask(__name__)
swagger = Swagger(app)


@swag_from("example.yml", methods=["GET"])
@app.route("/")
def example():
    return "Hello World!"


if __name__ == "__main__":
    app.run()

example.yml

responses:
  '200':
    description: Successful response
    schema:
      type: object
      properties:
        data:
          type: object
          properties:
            messages:
              type: array
              items:
                type: object
                properties:
                  level:
                    type: string
                  title:
                    type: string
                  uid:
                    type: integer
                  value:
                    type: string

http://127.0.0.1:5000/apidocs

By default, this example displayed with collapsed Schema model data:

enter image description here

but I need to expand it by default, like:

enter image description here

0

There are 0 best solutions below