Artur
Artur

Reputation: 51

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

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?

Upvotes: 3

Views: 3866

Answers (1)

Artur
Artur

Reputation: 51

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

Upvotes: 2

Related Questions