FasterXML / jackson-annotations

Core annotations (annotations that only depend on jackson-core) for Jackson data processor
https://github.com/FasterXML/jackson
Apache License 2.0
1.03k stars 330 forks source link

@JsonIdentityInfo Custom Generator : serializing id and ref differently ? #24

Closed redben closed 10 years ago

redben commented 10 years ago

I am trying to create a Custom Generator based on IntSequenceGenerator, I would like to serialize id and ref differently, like so

{ "a": { "@id": 1, "name": "foo"}, b: {"$ref" : 1}},

What I am getting right now is :

{ "a": { "@id":  {"$ref" : 1}, "name": "foo"}, b: {"$ref" : 1}}

Is what I am trying to achieve feasible in Jackson ?

redben commented 10 years ago

Just found this JSOG plugin, will investigate :) Sorry for disturbing.

cowtowncoder commented 10 years ago

No prob. For additional issues wrt Object Id handling, please use jackson-databind -- annotation package only contains annotations, not actual logic of using them. Object Id handling is somewhat limited, and it is an area we hope to improve in future.