joukevandermaas / saule

JSON API library for ASP.Net Web API 2.
https://joukevandermaas.github.io/saule
MIT License
76 stars 37 forks source link

Add JsonConverter Functionality On Serialization #238

Closed DtaggartMB closed 4 years ago

DtaggartMB commented 4 years ago

Added the ability for JsonConverters attached to the sourceobject properties to be triggered. Had to add filtering and depth counter to the ContractResolver so we don't serialize the whole object.

After some discussion about how this could be added. We didn't want to try and add logic that was creating instances of the converters that we might have to support given the number of different converters available. This simply invokes the Converters through the standard Json.Net serialization process.

This is missing tests, I will add them if you think this is a good solution, but it passes all existing ones. This aims to solve issue #237

Looking for input or alternative ways to achieve the same result.

edward-rosado commented 4 years ago

This looks good to me. If i understand this correctly It should ensure backward compatibility and give the developer the option on what contract resolver to use.