Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-7887

Allow customizing ObjectMapper in JsonSerde

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 2.7.0.Beta1
    • None
    • core-library
    • None

      Which use case/requirement will be addressed by the proposed feature?

      Currently, a new instance of an ObjectMapper is created in the JsonSerde, which cannot be customized. When using Kotlin, one would like to be able to register the Kotlin Module to this ObjectMapper.

      Implementation ideas

      Add a secondary constructor to JsonSerde that allows you to use a custom ObjectMapper.

      public JsonSerde(Class<T> objectType, ObjectMapper mapper) {
        this.mapper = mapper;
        mapper.registerModule(new JavaTimeModule());

        this.reader = mapper.readerFor(objectType);
      }

              Unassigned Unassigned
              mark.banierink Mark Banierink (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: