Results 1 to 1 of 1

Thread: REST Web Service - JSON with $ref node

  1. #1

    Default REST Web Service - JSON with $ref node

    Hello all,

    I'm doing a client implementation of a REST service on Spring Framework 3.2 with Jackson 2.1.3.

    Until now i could solve all the problems either by recurring to this forum or in Jackson specification. The problem began when an update to the server implementation was done in order to shring (even more ) the json message size. They began to use object references to duplicated entries in arrays. I will post a simple example of the following message format was used:
    [{"$id":"1","Name":"X"},
    {"$id":"2","Name":"Y"},
    {"$id":"3","Name":"Z"},
    {"$ref":"1"}]

    Consider the data model as the following:
    @JsonIdentityInfo(generator=ObjectIdGenerators.Int SequenceGenerator.class, property="$id")
    public class TypeW implements ITypeW {

    @JsonProperty(required=true, value="Name")
    protected String name;
    }
    I've seen examples of this working without that "$ref" entry and I'm wondering if I can customize or implement a specific deserializer in order to achieve the same result with the format that I've posted above.
    Last edited by ricardo.leal; Jan 28th, 2013 at 01:16 PM. Reason: tipo

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •