There may be multiple JsonFactory singletons in a application (such a textual JSON vs binary Json / Smile, etc etc). All of with extend from JsonFactory.
You can annotate any custom factories with @Secondary, and then for single injection the current bean will be used. You can then reference your own beans with @Named, etc..
MN 1.3.4
There may be multiple
JsonFactory
singletons in a application (such a textual JSON vs binary Json / Smile, etc etc). All of with extend fromJsonFactory
.https://github.com/micronaut-projects/micronaut-core/blob/1.3.x/runtime/src/main/java/io/micronaut/jackson/ObjectMapperFactory.java#L82 uses injection of
JsonFactory
. Can a@Named
be used on L82 such as@Named("json")
so other JsonFactory singletons can exist without them being injected into the default MN ObjectMapper ?