neo4j / neo4j-dotnet-driver

Neo4j Bolt driver for .NET
Apache License 2.0
231 stars 69 forks source link

IResultCursor.Current.Values changed output format #800

Closed mdfrenchman closed 4 months ago

mdfrenchman commented 4 months ago

Describe the bug Not sure this is a bug, but might be more an undocumented change.

The output of IResultCursor.Current.Values changed format when serialized to a string with .NET Driver Version 5.17.0 and prior (not sure of 5.18.1, didn't test it) format was: {'someKey':'someValue'}

with .NET Driver Version 5.20.0 format is: {'Key':'someKey', 'Value', 'someValue'}

To Reproduce

var resultCursor = await tx.RunAsync(query, params);
while (await resultCursor.FetchAsync()) 
{
  sb.AppendLine(jsonSerializer.Serialize(resultCursor.Current.Values));
}

Expected behavior I'd expect to see the change documented or mentioned.

Version Info (please complete the following information):

Additional context The Summary.Counters ICounter object still behaves the same way it used to. It also uses the same serialization method.

RichardIrons-neo4j commented 4 months ago

Hi there. Thanks very much for finding this! I'm investigating right now. I wonder if you could tell me how the jsonSerializer variable in your sample code is created, so that I can reproduce your situation exactly? Thanks!

mdfrenchman commented 4 months ago

Hey @RichardIrons-neo4j ,

var jsonSerializer = new JavaScriptSerializer();

Oddly, that class is coming from using System.Web.Script.Serialization;

It's an old code base (hence Framework), so not entirely sure why it's using that serializer.

I was able to test using System.Text.Json and that worked correctly as it's supposed to.

Chalk this up to an old System.Web Serializer and how it handles Dictionaries, I guess.