mgholam / fastJSON

Smallest, fastest polymorphic JSON serializer
https://www.codeproject.com/Articles/159450/fastJSON-Smallest-Fastest-Polymorphic-JSON-Seriali
MIT License
479 stars 147 forks source link

Unexpectedly reached end of string #113

Closed frankinstien closed 3 years ago

frankinstien commented 4 years ago

{ ID:9a42a291cf824fb5935ab4462755321c, UserName:logicalLogin, Password:xyz156, HashCode:1460319542, AccessLevel:owner, Database:CategoriesDb, ConnectionId:NA, Date:3/1/2020 }

The above json causes an exception of "Unexpectedly reached end of string" and this is due to the first element ID value is being parsed as a number rather than a string or Guid. I've tried using the AllowNonQuotedKeys set to true but I still get the same exception. Is there another setting to deal with this scenario?

frankinstien commented 4 years ago

I believe the problem is that the json is anonymous. So fastJson doesn't parse anonymous json?

mgholam commented 4 years ago

Proper json is in "property":"value" format what you have shown is not json but javascript.