-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to deserialize object #311
Comments
I can verify that all our tests work if we uncomment the two lines here: 33a78fd#diff-c9f5f40cbc0efb158b9bf3d487cb18c9R122 |
I don't understand why a Complex type shouldn't be enclosed in |
Not sure how to fix this. Note the following patch, which works for me, but changes the semantics. diff --git a/Neo4jClient.Shared/StatementResultHelper.cs b/Neo4jClient.Shared/StatementResultHelper.cs
index b35daa6..92935b1 100644
--- a/Neo4jClient.Shared/StatementResultHelper.cs
+++ b/Neo4jClient.Shared/StatementResultHelper.cs
@@ -119,8 +119,6 @@ namespace Neo4jClient
output.Add(s);
}
- if (isConcreteType)
- return string.Join(",", output);
return $"{{ {string.Join(",", output)} }}";
}
@@ -146,8 +144,7 @@ namespace Neo4jClient
}
else if (eType == typeof(Dictionary<string, object>))
{
- //here!!
- output.Add($"{{{e.ToJsonString(inSet, false, true, isConcreteType) ?? "null"}}}");
+ output.Add($"{e.ToJsonString(inSet, false, true, isConcreteType) ?? "null"}");
onlyKvp = false;
}
else
diff --git a/Neo4jClient.Tests.Shared/StatementResultHelperTests.cs b/Neo4jClient.Tests.Shared/StatementResultHelperTests.cs
index 59238ae..b2b0c28 100644
--- a/Neo4jClient.Tests.Shared/StatementResultHelperTests.cs
+++ b/Neo4jClient.Tests.Shared/StatementResultHelperTests.cs
@@ -209,7 +209,7 @@ namespace Neo4jClient.Test
record.Keys.Returns(new List<string> {"Data"});
record["Data"].Returns(list);
- var expectedContent = "{ \"columns\":[\"Data\"], \"data\":[[ [{\"Id\":1}] ]] }";
+ var expectedContent = "{ \"columns\":[\"Data\"], \"data\":[[ [{ \"Id\":1 }] ]] }";
var mockDeserializer = new Mock<ICypherJsonDeserializer<RecordWithListOfComplex>>();
mockDeserializer
.Setup(d => d.Deserialize(It.IsAny<string>()))
@@ -257,7 +257,7 @@ namespace Neo4jClient.Test
}
);
- var expectedContent = "{ \"columns\":[\"x\"], \"data\":[[ [{{ \"Info\":{\"A\":\"a\",\"B\":\"b\"} }}] ]] }";
+ var expectedContent = "{ \"columns\":[\"x\"], \"data\":[[ [{ \"Info\":{\"A\":\"a\",\"B\":\"b\"} }] ]] }";
var mockDeserializer = new Mock<ICypherJsonDeserializer<string>>();
mockDeserializer
.Setup(d => d.Deserialize(It.IsAny<string>())) |
Unfortunately - if I remember correctly - the test is correct - the way that the REST client returns the data is as the test has it - not as it should be. As it happens it didn't fix the issue I was trying to - so I'm happy to roll it back for now and try to get it done another way. Can you PR your patch? |
This reverts commit 33a78fd. See issue DotNet4Neo4j#311
Then this patch isn't correct. I think the best quickfix would be to revert the commit: #312 |
I think 33a78fd might have broken something
It's actually an F# type, so it would look more like this:
Here's the output which fails:
EDIT: This is only a problem with the Bolt client.
The text was updated successfully, but these errors were encountered: