0

I am currently using the this Jackson plugin

Which serialized my cyclical graphs. Then on the client I use the JSOG to decode the {@ref} objects like this:

JSOG.decode(data)

The problem comes when I am trying to send the json back up to the server. If I don't do anything to the data I get a "Maximum call stack size exceeded", obviously because my js object is cyclical. I try using:

JSOG.stringify(data);

But then Jackson chokes on all the @id and @refs:

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "@id"

Has any one figured out how to do this?

testing123
  • 11,367
  • 10
  • 47
  • 61

1 Answers1

0

Both sides need to be able to support JSOG convention. It is not part of JSON specification, nor can it be automatically detected; so Jackson can not process it without help.

StaxMan
  • 113,358
  • 34
  • 211
  • 239
  • Just out of curiousity, since the js objects share the same references couldn't I just just remove the '@id's and the properties that contain the '{@ref: 1}'s? Then one copy of the object with the circular reference will get persisted and wouldn't even need to be there. Thoughts? – testing123 Jun 28 '13 at 02:54
  • Doing that would create copies of objects, which may or may not work, depending on whether you have a connected graph or just DAG (former gives problems, latter won't) – StaxMan Jul 02 '13 at 18:06