You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a property of a data object has the field example, \n in this field are output verbatim instead of producing a newline. This makes it hard to output formatted JSON examples.
The text was updated successfully, but these errors were encountered:
This seems to be the same as bootprint/bootprint-openapi#77. Examples are raw JSON-objects and not strings. Try including your example directly as object. It should be formatted automatically.
I'm coming from @ApiModelProperty via swagger-jersey2-jaxrs, so I cannot use JSON-objects instead of strings. At least if I understand @ApiModelProperty correctly.
I would like to know what the JaxRS-people think about it. Maybe they have another solution for specifying complex examples.
But I reckon, they depend on swagger-ui's ability to derived complex example from the json-schema and the example-values in the leafs.
You may be able to solve your problem with a preprocessor that traverses the swagger-file and calls JSON.parse on all example values.
Writing examples verbatim would require a change in bootprint-json-schema. If you have an idea that works well for JSON-examples (that are real objects), I would accept a PR. Maybe examples can be output verbatim if the type of the schema is not "string", but the example itself is a "string"
When a property of a data object has the field
example
,\n
in this field are output verbatim instead of producing a newline. This makes it hard to output formatted JSON examples.The text was updated successfully, but these errors were encountered: