I am using Swagger to document a REST API.
I am having a class like this:
public class Source{
private String url;
private String category;
private String label;
...
}
I am currently using @ApiImplicitParam to set the dataType to Source.class, but I am having multiple POST requests that get a JSON as a body parameter with, lets say, a single variable of those, for example:
{"label": "labelA"}
Because of the dataType set previously, the example value displayed by the Swagger UI is a whole Source.class, something like this:
{
"url": "string",
"category": "string",
"label": "string",
...
}
Could I somehow chop the example value displayed by the Swagger UI for every single request of those? I mean that the getSourceFromUrl() request should get a JSON that contains only a url field, and the example should display exactly this and not the full Source.class JSON.
Thank you all in advance!
UPDATE
I am using JAX-RS. Please, ask me for more input if needed.