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

custom ObjectMapper feature #552

Merged
merged 8 commits into from
Nov 12, 2023
Merged

custom ObjectMapper feature #552

merged 8 commits into from
Nov 12, 2023

Conversation

pavelvic
Copy link
Contributor

Hello again my friends! There is no ability to use custom ObjectMapper in your Java-lib. The configuration of ObjectMapper is hardcoded in class "ISerializer"

public ISerializer(JsonFactory factor) {
        mapper = new ObjectMapper(factor);
        mapper.findAndRegisterModules();
        mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
        mapper.configure(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE, false);
        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    }

This is not good. I think there is a better way. For example, we can inject ObjectMapper from the client. So the client can configure mapper based on his needs. What do you think?

@oberstet
Copy link
Contributor

oberstet commented Nov 12, 2023

Hi Pawel, I had a look, and it makes a lot of sense, and it is also non-invasive for users. and the CI runs green for your PR. thanks for contributing! merging ..

@oberstet oberstet merged commit f8aa7ef into crossbario:master Nov 12, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants