northwesternmutual / grammes

A Go package built to communicate with Apache TinkerPop™ Graph computing framework using Gremlin; a graph traversal language used by graph databases such as JanusGraph®, MS Cosmos DB, AWS Neptune, and DataStax® Enterprise Graph.
Apache License 2.0
125 stars 45 forks source link

cannot unmarshal PropertyList #37

Open jhole89 opened 3 years ago

jhole89 commented 3 years ago

Hi,

First of all thank you for putting the work in on this project, its great and I would like to use it more, but I'm really struggling getting some of the described functionality working with a standard Tinkerpop/Gremlin instance.

Currently if I try to use the UnmarshalPropertyList functionality I receive an error of:

error unmarshalling data: {"type":"UNMARSHAL_ERROR"},{"function":"UnmarshalIDList"},{"rawBytes":"..."},{"error":"json: cannot unmarshal number into Go struct field PropertyID.@value.id.@value of type model.PropertyIDValue"}

To reproduce:

  1. Run official gremlin-server: docker run -d -p 8182:8182 tinkerpop/gremlin-server
  2. Run https://github.com/northwesternmutual/grammes/blob/master/examples/vertex-properties-example/main.go

Error received:

error unmarshalling data: {"type":"UNMARSHAL_ERROR"},{"function":"UnmarshalIDList"},{"rawBytes":"{"@type":"g:List","@value":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":93},"label":"firstname","value":"damien"}},{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":94},"label":"middlename","value":"socrates"}},{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":95},"label":"age","value":{"@type":"g:Int32","@value":19}}},{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":96},"label":"lastname","value":"stamates"}}]}"},{"error":"json: cannot unmarshal number into Go struct field PropertyID.@value.id.@value of type model.PropertyIDValue"}Label                Value   

I appreciate that the tinkerpop/gremlin-server container is the latest image (3.4.8 at time of writing), but I couldn't find anything saying which versions of Gremlin were/weren't supported.

Versions:

Any idea what may be going on here? Happy to do a quick patch.

MakDon commented 2 years ago

i met the same problem