swagger-core
swagger-core copied to clipboard
Parameter annotations (`@*Param`) from the Jersey2 should be supported in constructor(field)-level injections
Jersey2 parameter annotations won't be added to JSON
Resource:
@Path("/resource/{id}")
@Api(value = "/resource", description = "Summary of injections resource")
@Produces({"application/json", "application/xml"})
public class ResourceWithKnownInjections {
private Integer constructorParam;
@QueryParam("fieldParam")
private String fieldParam; // injection into a class field
@BeanParam
private Pagination pagination;
// injection into a constructor parameter
@Inject
public ResourceWithKnownInjections(Integer constructorParam) {
this.constructorParam = constructorParam;
}
JSON:
"paths": {
"/resource/{id}": {
"get": {
"tags": [
"resource"
],
"operationId": "get",
"produces": [
"application/xml",
"application/json"
],
"parameters": [
{
"name": "fieldParam",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "methodParam",
"in": "query",
"required": false,
"type": "string"
}
],
Fixed in develop_2.0.