Current look of Swagger request
Is it possible to change the body
{
"config": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"class": "string"
}
to look like
{
"class": "my.class.com",
"config": {
"myParam": "",
"datacenter": "USA",
}
Currently the method looks like this
@POST
@Path("/run")
@Consumes(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Runs a specified job asynchronously",
notes = "Doesn't work for full tasks.")
public Response createTask(TaskConfig taskConfig) {
TaskConfig is a basic class with two member variables
public class TaskConfig {
@JsonProperty("class")
@NotNull
private String clazz;
private Map<String, Object> config;
We are using Swagger 1.5 from this Dropwizard Swagger bundle library. I know that 2.0 has the @RequestBody annotation and I just want to make sure that is my only option before I go down the path of upgrading.
