Search code examples
phprestler

Formatting the Swagger output for classes


Is there a way to format the Swagger output in a better way when used with dummy classes? For example:

@return Account

The output is kind of messy for me due to the lack of new lines:

Messy class output from Swagger


Solution

  • It is created by swagger-ui at runtime, we will definitely be improving it over time We may replace it with model representation as formatted json instead.

    For now you may remove the @return comment and directly add the html you want (that places Response Information in the way you want) under the long description, it will show up the same way

    You can copy paste the same html you get on explorer for this purpose

    Also you don't have to do this for all api methods, only to those that have lot of fields and appear messy