3

Is there a way to make Swagger prettify the JSON on its own, without requiring the called library to output pretty JSON? I can't seem to find anything on the subject.

altocumulus
  • 21,179
  • 13
  • 61
  • 84
Mr Mikkél
  • 2,577
  • 4
  • 34
  • 52

1 Answers1

1

The answer to your question is on the projects's GitHub.

You can configure via web.xml:

<init-param>
  <param-name>swagger.pretty.print</param-name>
  <param-value>true</param-value>
</init-param>

or via BeanConfig:

config.setPrettyPrint(true)

I asked a similar question for the Swashbuckle library, here. Still waiting for an answer from Swashbuckle team.

Michael
  • 3,416
  • 1
  • 19
  • 21
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – jezrael Oct 27 '15 at 07:16
  • year old question, and if you opened the link there is no answer, yet. Merely trying to help people find the information or push Swashbuckle team to answer. – Michael Oct 27 '15 at 13:39
  • This doesn't seem to answer the question, since it's asking about Swagger UI, not just the Swagger library. – jtalarico Jan 05 '16 at 20:22