我已经开始使用 Swagger 来编写 API 文档。请帮我配置一下。如何在 Swagger UI 中默认展开 schema?
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()
例子.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
默认情况下,此示例显示折叠模式模型数据:
但我需要默认展开它,比如: