0

I´m using swagger on my java EE7 application (Glassfish as application server). Everything works fine except for a method with FormDataParam, which gave me the tradicional error:

org.glassfish.jersey.server.ContainerException: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.AnnotationIntrospector.findPropertyIndex(Lcom/fasterxml/jackson/databind/introspect/Annotated;)Ljava/lang/Integer;

I tried everything, but is just a method, so I do not want so badly this method in my swagger.json

How can I exclude this method from swagger. I tried:

@ApiModelProperty(hidden = true) and @ApiOperation(value="",hidden = true)
@POST
@Path("something")
@Produces(MediaType.TEXT_PLAIN)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public Response newsomething(@FormParam("something") String something,@Context HttpServletRequest request, @Context HttpServletResponse response) throws IOException {
    return "something";
}

What I´m doing wrong?

Justinas Jakavonis
  • 8,220
  • 10
  • 69
  • 114
Goldbones
  • 1,407
  • 3
  • 21
  • 55

2 Answers2

3

It's related with Glassfish, it use different version of Jackson. You need to upgrade Glassfish/Jackson. More details:

Community
  • 1
  • 1
Justinas Jakavonis
  • 8,220
  • 10
  • 69
  • 114
0

For me adding @ApiModelProperty(hidden = true) in paths worked Is it wrong or correct?

@ApiModelProperty(hidden = true)
@GET
@Produces({MediaType.APPLICATION_JSON})
@ApiOperation(value = "return getApi ",
        tags = {"getApi"},
        notes = "Returns a Array of getApi",
        hidden = true
        )
@ApiResponses(value = {
        @ApiResponse(response = GetApi.class, message = "", code = 200)
})
@Path("getApi")
public Response getApi(@Context HttpHeaders httpHeaders, @BeanParam QueryParamBean queryParamBean) {
             // codes..
}