Swagger UI-无法为请求正文启用JSON编辑器 [英] Swagger UI - can't enable JSON editor for the request body

查看:419
本文介绍了Swagger UI-无法为请求正文启用JSON编辑器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些问题要解决, 根据下面的链接,请求正文的JSON编辑器(默认情况下处于禁用状态).

I have some issue to make it work, according to following link below, the JSON editor for the request body (disabled by default).

https://github.com/jensoleg/swagger-ui

如何启用它?

推荐答案

我找到了解决方案.将以下内容添加到new SwaggerUi({})构造函数中的index.html中:

I found the solution. Add the following into index.html in the new SwaggerUi({}) constructor:

docExpansion: "none",
sorter: "alpha",
jsonEditor: true,
defaultModelRendering: 'schema',
showRequestHeaders: true

这篇关于Swagger UI-无法为请求正文启用JSON编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆