Description
Hello,
I am looking to extend JsonPatch to support the SCIM patch protocol. Specifically I am looking to add attribute filters within a list, rather than needing to rely solely on indexes. I have a fork with some basic functionality to prove it can be done, but I am trying to minimize the amount of code that needs to be maintained outside the main version. I would like to propose minor refactoring that would make it easier for me to extend JsonPatch to meet these needs. The actual logic could certainly be included in the base library, but I suspect that would cause unneeded confusion for anybody not leveraging Scim.
Basically I would like to make the following changes:
- Allow all Adapters to be inherited and their methods be overridden
- Create interfaces for ParsedPath and ObjectVisitor, in addition to allowing their methods to be overridden
- Create a new ObjectAdapterTyped which allows the implementation types of the ParsedPath and ObjectVisitor to be set via generics
- Update the existing ObjectAdapter to inherit from ObjectAdapterTyped with the current ParsedPath and ObjectVisitor types set, which should prevent any breaking changes to the interface
- Allow the Adapter selection to be customized - although this might be easier done just using a new concrete ObjectVisitor
I would also like to propose a change to the ObjectVisitor.TryTraverse which will attempt to create an empty object if the value is null. This would make it easier to Add a child value to a property that doesn't already exist. There may be limitations to the capabilities, but I believe it would be very helpful. However, this could be handled in a custom ObjectVisitor if required.
I think this will make it much easier for others to extend the JsonPatch capabilities to add additional support for standard protocols (like Scim) or simply to support additional non-standards complaint patch operations.
Since this requires some minor refactoring of the code base, I wanted to check in with the owners of the project before starting to get feedback on the overall approach.
I am also having some issues running the test project due to dependencies on Core 2.1 preview, and would like to get some assistance to ensure my changes do not cause any breaking changes for others.
Thanks!
Dave