kevin-montrose / Jil

Fast .NET JSON (De)Serializer, Built On Sigil

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JSON.DeserializeDynamic throws ArgumentException

Metalnem opened this issue · comments

JSON.DeserializeDynamic throws an ArgumentException when deserializing the file from the attached archive. You can run the following code to reproduce it (the path variable should contain the path to the extracted file):

using (var file = File.OpenText(path))
{
  JSON.DeserializeDynamic(file);
}

Found via SharpFuzz.

Your input file has the member pop twice, as stated in the exception (duplicate Key) and according to https://tools.ietf.org/html/rfc8259#section-4 this behaviour is undefined.

Yes, but in all other scenarios Jil throws DeserializationException, so I would expect it to either not throw, or throw DeserializationException, not ArgumentException.