Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Contract and Property Parameters to JsonConverter #2697

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

scptre
Copy link

@scptre scptre commented Jun 20, 2022

JsonConverter.cs

Added new JsonConverter abstract class JsonConverter2 with override to WriteJson with the Contract and Property parameters to allow features like TypeNameHandling.Auto handling to be added to the converter

JsonSerializerInternalWriter.cs

Added a check to the JsonSerializerInternalWriter.SerializeConvertable function to check for the new JsonConverter2 base class and call the WriteJson override with the contract and property parameters.

JsonConverter2Tests.cs

Added a test case to test the serialization of a collection with multiple types and the TypeNameHandling.Auto logic added to a JsonConverter2 converter.

----------------
Added new JsonConverter abstract class JsonConverter2 with override to WriteJson with the Contract and Property parameters to allow features like TypeNameHandling.Auto handling to be added to the converter

JsonSerializerInternalWriter.cs
-------------------------------
Added a check to the JsonSerializerInternalWriter.SerializeConvertable function to check for the new JsonConverter2 base class and call the WriteJson override with the contract and property parameters.

JsonConverter2Tests.cs
----------------------
Added a test case to test the serialization of a collection with multiple types and the TypeNameHandling.Auto logic added to a JsonConverter2 converter.
@scptre scptre changed the title JsonConverter.cs Add Contract and Property Parameters to JsonConverter Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant