@Override
    public void setupModule(SetupContext context) {
      super.setupModule(context);

      context.addBeanSerializerModifier(new BeanSerializerModifier() {
        @Override
        public JsonSerializer<?> modifySerializer(SerializationConfig config, BeanDescription desc,
            JsonSerializer<?> serializer) {
          if (!nonOverridableSerializers.contains(desc.getBeanClass())) {
            return new ContextAwareBeanSerializer<>(serializer);
          }

          return serializer;
        }

        @Override
        public JsonSerializer<?> modifyArraySerializer(SerializationConfig config,
            ArrayType valueType, BeanDescription beanDesc, JsonSerializer<?> serializer) {
          return new CustomArraySerializer<>(serializer);
        }
      });
    }
A Jackson module that installs serializer-modifiers to serialize type information for
all types based on the current serialization context.
geode-core/src/main/java/org/apache/geode/management/internal/json/QueryResultFormatter.java