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

Provide a way to tune jackson mapper #156

Closed
yarulan opened this issue Jan 9, 2019 · 4 comments
Closed

Provide a way to tune jackson mapper #156

yarulan opened this issue Jan 9, 2019 · 4 comments

Comments

@yarulan
Copy link

yarulan commented Jan 9, 2019

The library uses jackson to convert objects to json. I use vavr collections in my classes, therefore I need to add vavr support to jackson.

 mapper.registerModule(new VavrModule());

But mapper is private.

class Jackson2NodeFactory extends AbstractNodeFactory {
    private static final ObjectMapper mapper = new ObjectMapper();
@lukas-krecan
Copy link
Owner

Hi, thanks for feedback. Currently it is not possible to tune Jackson mapper, but you can serialize your object before comparison

assertThatJson(serialize(jsonObject1)).isEqualTo(serialize(jsonObject2))

where serialize() method takes the object and serializes it to String or to JsonNode tree.

I will try to figure out how to let people customize ObjectMapper in a maintainable and future-proof way.

@lukas-krecan
Copy link
Owner

Would something like this af3e9a9 be useful?

@yarulan
Copy link
Author

yarulan commented Jan 12, 2019

@lukas-krecan Totally, thank you!

@lukas-krecan
Copy link
Owner

Released a 2.3.0

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

2 participants