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

JAX-RS BeanParams issue with generic types

Open mhaefele opened this issue 9 years ago • 1 comments

Not sure how to best word this.

It seems that the generic information on @BeanParam parameters is not being used to generate the swagger.json.

I have a class

public class MyBeanParam<T> {
  @QueryParam
  T value;
}
public enum MyEnum {
A, B, C,
;
}
public interace MyResource {
  @GET
  public Object getStuff(@BeanParam MyBeanParam<MyEnum> params);
}

I'm expecting something like

... "parameters": [ {
   "name": "value",
   "type":"string",
   "enum":["A", "B", "C"]
}]

but getting

... "parameters": [ {
   "name": "value",
   "type":"string"
}]

without the enum information.

Changing io.swagger.jaxrs.DefaultParameterExtension to use getType() instead of getRawType() seems to fix the issue for me.

mhaefele avatar Mar 20 '17 16:03 mhaefele

Closing this issue as part of our backlog cleanup effort.
This issue is outdated and/or inactive for a long time, and we’re not able to revisit it meaningfully.

If this problem is still relevant, please open a new issue and reference this one for context.
Thank you for your understanding!

MichakrawSB avatar Mar 08 '26 19:03 MichakrawSB