-
Notifications
You must be signed in to change notification settings - Fork 285
Description
Bug Report
Describe the Bug
Currently we do fetch most of the time the ObjectMapper for JSON-LD processing in the initialize phase of extensions
by injecting the TypeManager and then doing
var jsonLdMapper = typeManager.getMapper(JSON_LD);
This can lead to an issue when the JSON_LD object mapper is not registered yet in the TypeManager.
I've encounter this while working on multi protocol webhooks PR
where I removed the ProtocolWebhook injectable replacing it by a ProtocolWebhookRegistry. This led to a different dependency injection timeline which causes some extension to fetch the JSON_LD ObjectMapper before it was configured by the JsonLdExtension
Possible Implementation
Move in the prepare phase or make it lazy the fetch of the required ObjectMapper
Additional but for future issues, we should make the Registry patter safe, ensuring that values cannot be read from a Registry during
the initialize phase.