-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
In io.quarkus.jackson.ObjectMapperCustomizer, use JsonMapper instead of ObjectMapper #24019
Comments
For outward compatibility producing a |
This is a pretty severe breaking change that could affect a lot of people. I am not sure I want to do that just yet. |
#23645 is also related |
What about in Quarkus 3.0? |
Perhaps |
An additional complexity here is that there are two "layers" of customization in Jackson: the main one is the mapper itself (through some val factoryBuilder = JsonFactoryBuilder(JsonFactory())
// apply customizations on the factoryBuilder
val factory = factoryBuilder.build()
val mapperBuilder = JsonMapper.builder(factory)
// apply customizations for the mapperBuilder
val mapper = mapperBuilder.build() Luckily, both these levels can be made more generic using the backing interfaces At my own work, I implemented a version of this that exposes a generic customizer interface that can be used on all levels: either all <factory/mapper> builders, or only the builders specific to a type such as JSON/YAML/CSV. For reference: https://gitlab.com/rug-digitallab/resources/common-quarkus/-/merge_requests/33/diffs. This implementation is currently fully backwards-compatible with the existing customizers. I would be happy to port this approach to Quarkus at some point when you deem this relevant. |
That seems interesting @FWest98! Would you like to open a draft PR showing what you have in mind? |
this would require a change in vert.x since https://github.com/eclipse-vertx/vert.x/blob/abc577783c5d33372328fd73a6faf598b4d520dc/vertx-core/src/main/java/io/vertx/core/json/jackson/DatabindCodec.java#L36 |
We already do this in our codebase by adding producers for In our code we don't use |
Description
As of 2.10, JsonMapper appears to be the preferred system.
This will require changing the default ObjectMapper producer and change the interface of ObjectMapperCustomizer.
What backward compatibility is required?
Implementation ideas
The text was updated successfully, but these errors were encountered: