1

The JSON response I'm trying to parse contains errors, but is out of my control. Specifically, a field which should normally be a number, is sometimes returned as an array, similar to this:

{ "myarray" : [
  { "myfield" : 1,   /*etc*/ }, 
  { "myfield" : [1], /*etc*/ },
  /* etc */
] }

Is there a way within JSON.NET to handle these kinds of special cases? Else I'll settle with a good old search and replace within the string before parsing.

Martin Plante
  • 4,553
  • 3
  • 33
  • 45

0 Answers0