You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Florian Hockmann (Jira)" <ji...@apache.org> on 2021/05/14 10:27:00 UTC

[jira] [Commented] (TINKERPOP-2564) Gremlin.NET: Can only use Dictionary with SubmitAsync

    [ https://issues.apache.org/jira/browse/TINKERPOP-2564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17344514#comment-17344514 ] 

Florian Hockmann commented on TINKERPOP-2564:
---------------------------------------------

Returning unserialized JSON is no longer supported out of the box in version 3.5.0 as stated in the [CHANGELOG|https://github.com/apache/tinkerpop/blob/3.5.0/CHANGELOG.asciidoc#release-3-5-0]:
{quote}Gremlin.Net driver no longer supports skipping deserialization by default. Users can however create their own {{IMessageSerializer}} if they need this functionality.
{quote}
Looks like we forgot to update [the upgrade docs|https://tinkerpop.apache.org/docs/3.5.0/upgrade/#serialization-3_5_0] there which still state that it's possible to return a {{JsonElement}} unfortunately.

You can use the included [{{GraphSONMessageSerializer}}|https://github.com/apache/tinkerpop/blob/master/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONMessageSerializer.cs] as a basis if you want to implement your own message serializer. You probably only have to omit the last two lines of the {{DeserializeMessageAsync}} method:

{code}
var data = _graphSONReader.ToObject(responseMessage.Result.Data);
return Task.FromResult(CopyMessageWithNewData(responseMessage, data));
{code}

 

> Gremlin.NET: Can only use Dictionary<string, object> with SubmitAsync
> ---------------------------------------------------------------------
>
>                 Key: TINKERPOP-2564
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2564
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: dotnet
>    Affects Versions: 3.5.0
>            Reporter: Kirk Marple
>            Priority: Major
>
> After upgrading to 3.5.0 of .NET Core driver, I'm trying to get my call to SubmitAsync working.
> This seems to be the only generic type that works w/o a cast error.
> await client.SubmitAsync<Dictionary<string, object>>(query)
> I'd thought I could use
> await client.SubmitAsync<JsonElement>(query)
> But I get a cast error from the dictionary to anything else I try.
> Any idea what I may be doing wrong?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)