ApiModelProperty doesn't support example for arrays / Lists
See original GitHub issueBy default array or List of integers is generated in UI with example:
"eventTypes": [0],
I’ve tried to add “example” property, but that:
@ApiModelProperty(required = true, example = "[2, 3]")
private int[] lorem;
generates example values as string:
"eventTypes": "[2, 3]",
Other options like "2, 3" don’t work neither. In result to have valid json in example it has to have only one value, zero.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:52
- Comments:48 (4 by maintainers)
Top Results From Across the Web
swagger @ApiModelProperty example value for List<String ...
So in conclusion, support for examples for arrays/Lists has been worked on and should be available in ... This seems to not be...
Read more >Specify an Array of Strings as Body Parameters in Swagger
In this tutorial, we'll show how to produce a default example value for String arrays, as this behavior is not enabled by default....
Read more >ApiModelProperty (swagger-annotations 1.6.9 API)
Allows a model property to be hidden in the Swagger model definition. ... Specifies if the parameter is required or not.
Read more >Spring Boot + Swagger2- Understanding various Swagger ...
Various Swagger annotations are available to help document the REST APIs. ... Since this is displayed in the list of operations in Swagger-UI...
Read more >ApiModelProperty (swagger-annotations 1.6.2 API) - javadoc.io
There are three ways to describe the allowable values: To set a list of values, provide a comma-separated list. For example: first, second,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

it’s work
This takes a major refactoring of the models, which is on the way.