Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to customize Jackson ObjectMapper #1308

Closed
viniciusccarvalho opened this issue Jan 4, 2019 · 6 comments
Closed

Unable to customize Jackson ObjectMapper #1308

viniciusccarvalho opened this issue Jan 4, 2019 · 6 comments

Comments

@viniciusccarvalho
Copy link

Hi there, I'm trying to use the library with Kotlin, and I'm reading some CRDs that I have defined, but because the WatchHTTPManager class creates a mapper without allowing customization:

I can't create add a module to jackson object mapper. Is there a way around this? Adding custom modules on jackson may be required for other usages besides kotlin

Regards

@salaboy
Copy link

salaboy commented Jan 18, 2019

@viniciusccarvalho damn.. I am stuck with this one as well. We might better provide a PR to fix it and hope for a release :)

@jkremser
Copy link

probably WatchHTTPManager class should be initializing the mapper field by calling Serialization.jsonMapper(), because that one can be easily customized by something like:

Serialization.jsonMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, 
false);

@stale
Copy link

stale bot commented Sep 19, 2019

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

@stale stale bot added the status/stale label Sep 19, 2019
@stale stale bot closed this as completed Sep 26, 2019
@rohanKanojia rohanKanojia reopened this Sep 26, 2019
@stale stale bot removed the status/stale label Sep 26, 2019
@novakov-alexey-zz
Copy link

Also faced with issue when trying to deserialize Scala case classes

@novakov-alexey-zz
Copy link

thanks to @jkremser, I am able to customize mapper like this:

Serialization.jsonMapper().registerModule(DefaultScalaModule)

@manusa
Copy link
Member

manusa commented Jan 29, 2020

This should no longer be an issue after #1963
WatchHTTPManager now uses Serialization class

Following should work now:

Serialization.jsonMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, 
false);

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

No branches or pull requests

6 participants