-
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
Move standard ObjectMapper
customization to dedicated Customizer
#40819
Conversation
...nsions/jackson/runtime/src/main/java/io/quarkus/jackson/runtime/ConfigurationCustomizer.java
Show resolved
Hide resolved
Makes sense! Can you please squash the commits? |
This will allow users to produce their own custom ObjectMappers with the same base behaviour as the one offered by Quarkus.
cc0d36d
to
5e259f1
Compare
@@ -111,6 +112,8 @@ public class JacksonProcessor { | |||
@BuildStep | |||
void unremovable(Capabilities capabilities, BuildProducer<UnremovableBeanBuildItem> producer, | |||
BuildProducer<AdditionalBeanBuildItem> additionalProducer) { | |||
additionalProducer.produce(AdditionalBeanBuildItem.unremovableOf(ConfigurationCustomizer.class)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the correct way of doing it? Or should I use the producer
instead of the additionalProducer
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should work just fine :)
@geoand I managed to fix my testing issue and squashed the commits! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Status for workflow
|
This change moved the standard
ObjectMapper
customization behaviour to its own dedicatedObjectMapperCustomizer
with maximum priority. This way, these default (config-driven) customizations are available to anyone injecting all Customizers in their own code when creating customObjectMapper
instances - such as ones based on YAML or other formats.The current code has these customizations tied to the instantiation of a default
ObjectMapper
- thus unavailable to anyone constructing aYAMLMapper
,CsvMapper
, or any of the other custom data formats. Other customizations of theObjectMapper
offered by Quarkus (such as OTel-specific ones) are offered through theObjectMapperCustomizer
interface. This MR makes the situation more consistent, allowing users to inherit all Quarkus customizations.The new customizer has the highest priority to ensure that the customizations remain applied in the same order.