ktor icon indicating copy to clipboard operation
ktor copied to clipboard

Adds support for custom jackson mapper and lazy initialization

Open frederic-kneier opened this issue 3 years ago • 2 comments

Subsystem Client/Server, related modules

Motivation Current implementation of jackson content negotiation does not allow to provide a custom mapper instance or to lazily initialize the instance to improve startup time.

Solution The initializer function for jackson support now allows to provide a custom mapper provider and to enable lazy initlialization

frederic-kneier avatar Sep 06 '21 09:09 frederic-kneier

Lazy initlialization greatly improves startup time for ktor servers. Especially if jackson mapper is used. Would it be possible to allow lazily register a converter that is actually created once it is first used?

frederic-kneier avatar Oct 29 '21 08:10 frederic-kneier

@frederic-kneier You are right, it's useful for servers. Do you mind rebasing this PR to the latest main branch? Please note that JacksonConverter was moved to :ktor-shared:ktor-serialization:ktor-serialization-jackson module.

rsinukov avatar Oct 29 '21 13:10 rsinukov