JSON deserializer doesn’t recognise __type if formatted

I’ve noticed that the .NET DataContractJsonSerializer doesn’t recognise the __type if you format the JSON and it’s not the first __type in the document.

To workaround this but still have semi-formatted JSON, ensure the “__type” immediately follows the opening curly brace.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s