code: protected void configureObjectMapper(final ObjectMapper mapper) {
          mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false)
              .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
  
          mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
          mapper.setVisibility(PropertyAccessor.SETTER, JsonAutoDetect.Visibility.PROTECTED_AND_PUBLIC);
          mapper.setVisibility(PropertyAccessor.GETTER, JsonAutoDetect.Visibility.PROTECTED_AND_PUBLIC);
          mapper.setVisibility(PropertyAccessor.IS_GETTER, JsonAutoDetect.Visibility.PROTECTED_AND_PUBLIC);
  
          if (isDefaultTypingEnabled()) {
              mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
          }
          mapper.findAndRegisterModules();
      }
docs: Configure mapper.
  
  @param mapper the mapper