Swagger UI - can't enable JSON editor for the request body

强颜欢笑 提交于 2019-12-10 19:44:05

问题


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

How can I enable it?


回答1:


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


来源:https://stackoverflow.com/questions/37441859/swagger-ui-cant-enable-json-editor-for-the-request-body

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!