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

Make ObjectMapper configurable via JinjavaConfig #815

Merged
merged 4 commits into from
Jan 26, 2022

Conversation

bkrainer
Copy link
Contributor

@bkrainer bkrainer commented Jan 26, 2022

The ObjectMapper used by tojson is just a plain new ObjectMapper() which can cause serialization issues like:

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type `java.time.ZonedDateTime` not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling

This makes ObjectMapper configurable via JinjavaConfig for more control / consistency.

@bkrainer bkrainer changed the title Register JavaTimeModule in toJson filter Make ObjectMapper configurable via JinjavaConfig Jan 26, 2022
@bkrainer bkrainer merged commit 0f6111c into master Jan 26, 2022
@bkrainer bkrainer deleted the java-8-datetime-module branch January 26, 2022 18:56
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.

1 participant