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?
It's related with Glassfish, it use different version of Jackson. You need to upgrade Glassfish/Jackson. More details:
java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.AnnotationIntrospector.findPropertyIndex(Lcom/fasterxml/jackson/databind/introspect/Annotated;)Ljava/lang/Integer
solution https://github.com/swagger-api/swagger-core/issues/1001java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.AnnotationIntrospector.findPropertyIndex(Lcom/fasterxml/jackson/databind/introspect/Annotated;)Ljava/lang/Integer;
solution - https://groups.google.com/forum/#!topic/swagger-swaggersocket/uQEn-anX_Ogjava.lang.NoSuchMethodError: com.fasterxml.jackson.databind.AnnotationIntrospector.findPropertyDesc
solution https://groups.google.com/forum/#!topic/swagger-swaggersocket/x-Pz_3orTCE