Jackson Deserializer not called for @ * Param

I am trying to use JsonDeserialzer for the jax path parameter.

Here is my @BeanParam object,

@BeanParam private CustomerWrapper reference; @QueryParam("select") private String select; @QueryParam("count") private boolean count; @BeanParam PaginationInfo paginationInfo; @BeanParam private SortingInfo sortingInfo; @QueryParam("line") private String line; @QueryParam("typeCode") private String typeCode; class CustomReference { @NotNull @PathParam("profileReferenceId") @Encoded private String referenceId; public CustomerReference(String referenceId) { this.referenceId = referenceId; } public CustomeReference fromString() { return new CustomerReference(Base64.decode(referenceId)); } } 

The referenceId field is base64 encoded, to decode it, I use jsondeserializer.

However, I read json messagereader, does not work with jax @ * parameters.

From another post, I realized that this can be achieved by creating javax.ws.rs.ext.ParamConverterProvider .

 Example, @Provider public class TestClass implements ParamConverterProvider { private Logger logger = LoggerFactory.getLogger(TestClass.class); @Override public <T> ParamConverter<T> getConverter( Class<T> rawType, Type genericType, Annotation[] antns) { logger.debug("rawtype " +rawType.getName()); for(Annotation a : antns) { logger.debug("anotations " +a.annotationType().getName()); } return null; } } output: [DEBUG] 31 Oct 2016 23:20:23,788 DEBUG [http-nio-8082-exec-1] TestClass - rawtype boolean [DEBUG] 31 Oct 2016 23:20:23,788 DEBUG [http-nio-8082-exec-1] TestClass - anotations javax.ws.rs.QueryParam 

why this converter recognizes only one request and ignores the others.

0
java jackson spring-boot jersey jax-rs
Nov 01 '16 at 6:24
source share

No one has answered this question yet.

See similar questions:

2
Jackson JsonDeserialize not called for @QueryParam

or similar:

2108
How can I name one constructor from another in Java?
1187
Do I need a null check before calling instanceof?
611
How do I tell Jackson to ignore the field during serialization if its value is zero?
588
Jackson with JSON: unrecognized field not marked as ignorant
576
Ignoring new JSON object fields using Jackson
562
How to use Jackson to deserialize an array of objects
365
Endless recursion with the release of Jackson JSON and Hibernate JPA
310
Jackson v. Gson
188
Jackson Relocation Serialization and Deserializer
87
How to call a default deserializer from a custom deserializer in Jackson



All Articles