For the visibility bit, you can set VisibilityChecker instead of using the convenience method setVisibility
vc(VisibilityChecker.Std, Visibility.ANY) objectMapper(ObjectMapper) { visibilityChecker = ref('vc') }
but the configure call is more complicated, you will need to use the factory bean approach to call the method, defining a separate bean. The fact is that you do not want to call methods yourself, and you are trying to tell Spring that he needs to call when he wants to create beans:
objectMapperConfig(objectMapper:'configure', DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
Since configure returns a reference to the translator itself, the best way to ensure that the dependencies are resolved in the correct order might be to say
vc(VisibilityChecker.Std, Visibility.ANY) objectMapperUnconfigured(ObjectMapper) { visibilityChecker = ref('vc') } objectMapper(objectMapperUnconfigured:'configure', DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
and then use objectMapper as the bean that you enter elsewhere.
source share