【问题标题】:Prettify Json response in Swagger UI在 Swagger UI 中美化 Json 响应
【发布时间】:2021-03-29 14:16:42
【问题描述】:

有没有办法在 Swagger UI 的响应正文中美化 JSON? 我正在使用 SwaggerUIBundle。

【问题讨论】:

  • 改用 Wirespec。它比 Swagger 好得多,并且具有 JSON 的内置格式。 wirespec.dev
  • 我相信 Swagger UI 默认会漂亮地打印 JSON 响应。你的回复真的是Content-Type: application/json吗?

标签: json httpresponse swagger-ui pretty-print


【解决方案1】:

我的 API 返回 Content-Type 的文本内容。使用 Flask 作为代理,只返回 requests 响应的内容。这篇 SO 帖子帮助了 Return a requests.Response object from Flask

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-26
    • 2021-11-23
    相关资源
    最近更新 更多