Forum Discussion

KayS's avatar
Occasional Visitor
12 months ago

Formatting of object examples



When I provide examples of simple types, like strings, in my Open API spec, the output formatting is fine, but when I provide examples of list types or objects, the example is displayed in plain text with no return characters or indenting:

Excerpt from Open API spec:

type: array
description: email addresses
type: string


[example: List [ "", "" ]


Meanwhile, the examples in response codes are nicely formatted with return characters and indenting.


Obviously this isn't a big problem for a simple, contrived example like I've provided, but in examples of complex arrays and objects, this is impacting the usability of the generated documentation.


Is anyone else experiencing this? Is there a way to get examples in the Schemas section to display with return characters and indenting? 

1 Reply

  • chichepo's avatar
    Champion Level 2

    Hi KayS 
    It seems to be the "normal" behavior of the schema area.
    As far as I know, this part is providing a "structural" presentation of the objects and their properties and I am not sure it is intended to "render" the objects content.

    In another hand, and for "rendering" of complex structure, I prefer to add "examples".