Not sure if this answer will be helpful for anyone, but here are the roots of issue.
The core issue was on the client side, not on spring-boot-admin server side. As @Erik P (thanks a lot for great help!) mentioned in https://github.com/codecentric/spring-boot-admin/issues/3830 it's not possible to reconfigure objectMapper on spring-boot-admin server side.
On the client side there were 2 issues, both related to WebMvcConfigurer. Actuator server creates child WebAppContext, but the issue is that it still 'sees' my WebMvcConfigurer. It applies it to itself, changing the default output. Spring-boot-admin is not able to work with it.
public static class WebMvcConfig implements WebMvcConfigurer {
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
//1. This specific one makes actuator endpoint return 'content-type: application/json' instead of
//'application/vnd.spring-boot.actuator.v2+json;charset=UTF-8' this results spring-boot-admin to process json
//with LegacyEndpointConverter, which then throws that error:
//`java.util.ArrayList<java.lang.Object>` from Object value (token `JsonToken.START_OBJECT`)
configurer.defaultContentType(MediaType.APPLICATION_JSON_UTF8, MediaType.ALL);
...
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
//2. The second issue was related to the fact that we reconfigured default ApplicationContext's ObjectMapper
//(bad for us, don't do like this). Our changes also were changing default behaviour, and spring-boot-admin didn't work.
I was able to solve both this issues by separating application contexts as below:
+---------------------------+ +---------------------------+
| Root WebAppContext | | Root AppContext |
| | +---------------------------+
| contains WebMvcConfigurer | / \
+---------------------------+ PLAN --> / \
| | / \
+---------------------------+ +---------------------------+ +---------------------------+
| Child-actuator | | Child WebAppContext | | Child-actuator |
| WebAppContext | | contains WebMvcConfigurer | | WebAppContext |
| consumes WebMvcConfigurer | +---------------------------+ +---------------------------+
| and breaks spr-boot-admin | PROFIT
+---------------------------+
With above approach the configureContentNegotiation() issue is solved, the configureMessageConverters() issue is more tricky to solve (since ObjectMapper is still located in root ApplicationContext) but also solvable (for actuator i've registered separated WebMvcConfigurer, which was setting up clean, non-changed ObjectMapper) Exact configurations for the above solution see in Separating spring applicationContext: autoconfigure webMvc in child context