Github user okram commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/499#discussion_r88915459 --- Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java --- @@ -175,8 +177,30 @@ public PropertyJacksonSerializer() { public void serialize(final Property property, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider) throws IOException { jsonGenerator.writeStartObject(); - jsonGenerator.writeObjectField(GraphSONTokens.KEY, property.key()); + jsonGenerator.writeStringField(GraphSONTokens.KEY, property.key()); jsonGenerator.writeObjectField(GraphSONTokens.VALUE, property.value()); + if (property.element() instanceof VertexProperty) { + VertexProperty vertexProperty = (VertexProperty) property.element(); + jsonGenerator.writeObjectFieldStart(GraphSONTokens.ELEMENT); + jsonGenerator.writeStringField(GraphSONTokens.VALUETYPE, "g:VertexProperty"); + jsonGenerator.writeObjectFieldStart(GraphSONTokens.VALUEPROP); + jsonGenerator.writeObjectField(GraphSONTokens.ID, vertexProperty.id()); + jsonGenerator.writeStringField(GraphSONTokens.LABEL, vertexProperty.label()); + jsonGenerator.writeObjectField(GraphSONTokens.VERTEX, vertexProperty.element().id()); --- End diff -- Because a `VertexProperty` is attached to a `Vertex` and thus, generalized `Element` semantics would only cause a chain of JSON unnecessary when `Vertex` attachement only requires a single ID -- the vertex id.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---