jersey-jwt icon indicating copy to clipboard operation
jersey-jwt copied to clipboard

not able to use you Customizing ObjectMapper in a JAX-RS application example

Open gclouds opened this issue 6 years ago • 1 comments

gclouds avatar Aug 31 '18 12:08 gclouds

this below does not works for me `@Provider public class ObjectMapperContextResolver implements ContextResolver<ObjectMapper> {

private final ObjectMapper mapper;

public ObjectMapperContextResolver() {
    this.mapper = createObjectMapper();
}

@Override
public ObjectMapper getContext(Class<?> type) {
    return mapper;
}

private ObjectMapper createObjectMapper() {
    ObjectMapper mapper = new ObjectMapper();
    mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
    return mapper;
}

}`

gclouds avatar Aug 31 '18 12:08 gclouds