Skip to content

Upgrade to Jackson 2.10.0 #307

@linux-china

Description

@linux-china

Now scalecube-cluster use jackson 2.10.0.pr1

<jackson.version>2.10.0.pr1</jackson.version>

But some api removed in Jackson 2.10.0 and DefaultObjectMapper.java can not work because of following code:

 mapper.enableDefaultTyping(
        LaissezFaireSubTypeValidator.instance,
        DefaultTyping.JAVA_LANG_OBJECT,
        JsonTypeInfo.As.WRAPPER_OBJECT);

enableDefaultTyping has been removed from Jackson 2.10.0

Could we change DefaultObjectMapper to public? For some cases, if you use Jackson for en/decoding, maybe want to call Objecct.registerModule() to register some module, and now it's hard because DefaultObjectMapper is not public.

I did some testing, and now DefaultObjectMapper is not compatible with CloudEvents Java SDK, and can not en/decoding CloudEventImpl https://github.com/cloudevents/sdk-java/blob/master/api/src/main/java/io/cloudevents/v1/CloudEventImpl.java

        DefaultObjectMapper.OBJECT_MAPPER.registerModule(new Jdk8Module());
        final SimpleModule module = new SimpleModule();
        module.addSerializer(ZonedDateTime.class, new ZonedDateTimeSerializer());
        module.addDeserializer(ZonedDateTime.class, new ZonedDateTimeDeserializer());
        DefaultObjectMapper.OBJECT_MAPPER.registerModule(module);   

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions