I have the following setup with v1.5.3 and jaxrs 2:
@ApiModel (description = "The environment")
public enum Environment {
QA("qa"),
PRODUCTION("prod");
private final String name;
private Environment(String period) {
this.name = period;
}
@JsonValue
public String toString() {
return name;
}
}
I define an implicit param who's value should be defined in the enum above like so:
@ApiImplicitParam (dataType = "string", name = "env", value = "Narrow query by specifying an existing Environment", paramType = "query", required = false, allowableValues = "qa, prod")
I would like a more automated way of defining this param. More specifically, I would like to define the dataType of the param to be Environment and have the allowableValues be deduced from that. E.g:
@ApiImplicitParam (dataType = "Environment", name = "env", value = "Narrow query by specifying an existing Environment", paramType = "query", required = false)
Is there any functionality that can produce this behavior?
The logic of @ApiImplicitParam is very simple and it's pretty much as if you were writing that part of the definition yourself, so no, there's no functionality to produce that behavior.
I believe the answer is no.