swagger-core icon indicating copy to clipboard operation
swagger-core copied to clipboard

Parameter annotations (`@*Param`) from the Jersey2 should be supported in constructor(field)-level injections

Open iushankin opened this issue 11 years ago • 1 comments

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"
        }
      ],

iushankin avatar Jun 22 '15 16:06 iushankin

Fixed in develop_2.0.

webron avatar Jul 15 '15 10:07 webron