Skip to content

Support for non-scalar ObjectId Reference deserialiazation #622

@redben

Description

@redben

I am using JSOG by @stickfigure which works beautifully for serialization, but there seems to be an issue with deserialiazation since only scalar values are supported for ObjectIds. It would really be helpfull if this could work.

Below are suggestions from Tatu on the user-list:

The reason it does not work is simple: BeanDeserializer has to use heuristics to know whether value it is looking at might be an object reference [..] Only scalars can be object ids from its perspective.
[...] but maybe, just maybe, we could limit this, to only checking the name of the very first property within Object? If JSOG uses single-property ("$ref") objects -- which I think it does? -- perhaps it is possible to change things such that this detection could work.

and

One quick comment: you can actually globally enable this style of identity inclusion by a custom AnnotationIntrospector -- it can claim(*) that @JsonIdentityInfo was found. If JSOG is registered as a module you can also register such an introspector (to augment whatever default one existed).

(*)I am not familiar with how jackson "does things", otherwise I would have translated the "it can claim that @JsonIdentityInfo was found" to code and this issue would not be :)

There is this comment on BeanDeserializerBase

Discussions on the user-list I have found :
https://groups.google.com/d/topic/jackson-user/4jf2E_FKOIk/discussion
And the initial one between Jeff and Tatu
http://markmail.org/message/n6vrh4zi5nm3r3wt#query:+page:1+mid:nxpbwkisautcjl7u+state:results

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions