Skip to content

Conversation

@linux-china
Copy link
Contributor

  • "enableDefaultTyping" is deleted from ObjetMapper and replaced by "activateDefaultTyping"
  • Change DefaultObjectMapper to public, and allow developers to customize ObjectMapper's configuration. For example support CloudEventImpl en/decoding from CloudEvents Java SDK

@artem-v
Copy link
Contributor

artem-v commented Mar 10, 2020

@linux-china when you say

For example support CloudEventImpl en/decoding from CloudEvents Java SDK

Do u mean this -- https://github.com/cloudevents/spec?

Copy link
Contributor

@artem-v artem-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't make public on DefaultObjectMapper\s. They are supposed to be package private, if u need custom ObjectMapper to put into io.scalecube.cluster.codec.jackson.JacksonMessageCodec/io.scalecube.cluster.codec.jackson.smile.JacksonSmileMessageCodec then use corresp. constructor.

@linux-china
Copy link
Contributor Author

@linux-china when you say

For example support CloudEventImpl en/decoding from CloudEvents Java SDK

Do u mean this -- https://github.com/cloudevents/spec?

yes. https://github.com/cloudevents/sdk-java

@artem-v
Copy link
Contributor

artem-v commented Mar 11, 2020

Check this one:

https://github.com/FasterXML/jackson-modules-java8#jackson-2x
https://github.com/FasterXML/jackson-modules-java8#notes-on-registration

Also note that before Jackson 2.10, auto-registration will only register older JSR310Module, and not newer JavaTimeModule -- this is due to backwards compatibility. This is changed in Jackson 2.10.

Since u're going to set 2.10 so go and try this option mapper.findAndRegisterModules() (modules shall be registered automatically).

Copy link
Contributor

@artem-v artem-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes: #308 (comment)

@linux-china
Copy link
Contributor Author

Check this one:

https://github.com/FasterXML/jackson-modules-java8#jackson-2x
https://github.com/FasterXML/jackson-modules-java8#notes-on-registration

Also note that before Jackson 2.10, auto-registration will only register older JSR310Module, and not newer JavaTimeModule -- this is due to backwards compatibility. This is changed in Jackson 2.10.

Since u're going to set 2.10 so go and try this option mapper.findAndRegisterModules() (modules shall be registered automatically).

Great idea 👍 Just register modules on services/com.fasterxml.jackson.databind.Module file, and ObjectMapper customized done.

@artem-v
Copy link
Contributor

artem-v commented Mar 11, 2020

Check this one:
https://github.com/FasterXML/jackson-modules-java8#jackson-2x
https://github.com/FasterXML/jackson-modules-java8#notes-on-registration

Also note that before Jackson 2.10, auto-registration will only register older JSR310Module, and not newer JavaTimeModule -- this is due to backwards compatibility. This is changed in Jackson 2.10.

Since u're going to set 2.10 so go and try this option mapper.findAndRegisterModules() (modules shall be registered automatically).

Great idea Just register modules on services/com.fasterxml.jackson.databind.Module file, and ObjectMapper customized done.

Fix codacy. It complains about unused imports.

@artem-v artem-v merged commit a8a53da into scalecube:develop Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants