Open nickarls opened 1 year ago
Hi, it's currently not possible. But it should be possible to do something like this for Gson. Feel free to submit PR
It would be handy to have it on API level. something like .withNodeFactory(MyGsonNodeFactory) with a default getGson() in GsonNodeFactory that returns new Gson() could be overridden. Or the GsonNodeFactory could have an abstract getGson() that the default implemention would implements as new Gson(). Could could have different ones for different tests...
(haven't checked if it's that applicable to the other serializers but I would assume that they all set up some context)
Sorry, I forgot about this issue. I will be reluctant to do something like you propose as it would mean making the NodeFactory and Node part of the public API/SPI hindering future refactorings.
The documentation section "Selecting underlying library" mentions how to pick gson but how do you pick a specific instance (e.g. the one with the registered type adapters you need)?