-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Add actuator specific ObjectMapper #12951
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
Comments
I wonder if we should create our own |
If we do, I am expecting some stuff to be configurable. For instance, you may want that |
We document the actuator's format for
On the other hand, I agree with this. While it may be a bad thing that configuring the global |
I am not surprised but for some reason I completely eluded that. I think it's going to be quite hard to do this right. Users may care about a single |
If we add an Actuator-specific |
Referring to initial title where the problem where detected. For the Health actuator I think that adding Jackson annotation also for the |
Currently the easiest way to reconfigure the global ObjectMapper without having the actuator endpoints affected is this:
I'd really like to submit a PR for spring boot that takes this approach, as it would make the actuators' format "stable" (useful for spring boot admin users). WDYT @wilkinsona @snicoll, is such a PR worth it? |
Interesting approach, @joshiste. Unfortunately, there's a bit more to it I think as the Actuator also uses an In short, I don't think such a PR is worth it right now. We may end up taking an approach like the one you have proposed, but I think some investigation and experimentation is needed first. |
@philwebb you added the |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Let's start exploring this for 2.3.0.M2. |
I've just closed this issue, opting for an Actuator-specific The JSON mapper becomes now an implementation detail of Actuator. Jackson was already a hard dependency, but this time the mapper is totally independent from the rest of the application. This has the following advantages:
There are some downsides to that approach. First, we're making #1789 worse because we now have 3 Also, this |
We need to revert that change because of #20211. With the current Actuator setup, a custom annotation-based Instead, we should consider whether we can implement the MVC web adapter layer for Actuator using Servlet Functional Endpoints, see #20290. In that mode, the message converters would be limited to that specific |
Actually, closing in favor of #20291 as we need to keep this issue tied to the released 2.3.0.M2 version. |
Uh oh!
There was an error while loading. Please reload this page.
When using a custom object mapper with
MapperFeature.AUTO_DETECT_GETTERS
disabled the detailed information for Health endpoint is not returned.The status is returned as expected but not the detailed information.
From the code the
getStatus
method has Jackson annotation but thegetDetails
is lacking annotation.Problem found using SpringBoot spring-boot-starter-parent version 2.0.1.RELEASE.
As a workaround and for verification of the problem is related to Jackson an MixIn class where created annotation for getStatus and getDetails and after that the information where displayed as expected.
How to repeat:
The text was updated successfully, but these errors were encountered: