Closed matteo-prosperi closed 3 months ago
As I suspected, we already have a pattern to fix this. Have you seen the DelegatingServiceJsonRpcDescriptor
class? When you are wrapping another descriptor with a custom one, your custom one is supposed to derive from DelegatingServiceJsonRpcDescriptor
, which lets you call your own CreateFormatter
method and it invokes the inner one.
There are current implementations that wrap an existing
ServiceJsonRpcDescriptor
into anotherServiceJsonRpcDescriptor
-derived class. These implementations need to callCreateFormatter
on the inner descriptor and they currently use reflection to do so. UnfortunatelyCreateFormatter
isprotected internal
, so it cannot be made public without breaking the compilation of extended classes that are overriding this method. For this reason, I propose creating a new public method to make theCreateFormatter
capability publicly accessible.