-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Actuator endpoints support for Jackson's Serialization Views #24378
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'm personally not too keen to tie our actuator infrastructure any further Jackson. We have a long standing issue to support other serialization technologies and I think adding direct If you're happy only supporting Spring MVC, you could look at the |
Flagging to see what the rest of the team think about adding |
That's my feeling too. An alternative to |
@wilkinsona, thank you for the idea to turn the DTO into a Map and return Map instead. |
Since there's a work-around, I'm going to politely decline this one. Thanks anyway for the suggestion. |
I am writing actuator endpoint having two
@ReadOperation
-s, one without@Selector
, one with:@ReadOperation
without the selector is returning a collection of DTOs. That DTO contains a potentially long List of objects. To avoid cluttering output with all elements of the list, I would like to return only last element of the list in each DTO.@ReadOperation
with the selector is returning one DTO. In that case, I want to return all elements of the inner DTO list.A convenient way to do this is by using Jackson's Serialization Views. Two views are defined, and
@JsonView
annotations are added to DTO getters and methods annotated with@ReadOperation
. The output is not affected by annotations presence.Simplified example:
After converting actuator endpoint to @RestContoler output is affected.
Simplified example:
Having in mind that Jackson's Serialization Views are supported in Spring Framework since version 4.2, it will be nice to have similar support for actuator endpoints.
The text was updated successfully, but these errors were encountered: