Results 1 to 2 of 2

Thread: Jackson - Enum Serialization

  1. #1
    Join Date
    Jun 2009
    Posts
    9

    Default Jackson - Enum Serialization [solved]

    Hi,

    How configure Jackson so the serialization of enums in my pojos write the ordinal and name value ?

    now is:

    Code:
    {
      "name" : { "first" : "Joe", "last" : "Sixpack" },
      "gender" : "MALE",
      "verified" : false,
      "userImage" : "Rm9vYmFyIQ=="
    }
    i need:

    Code:
    {
      "name" : { "first" : "Joe", "last" : "Sixpack" },
      "gender" {"ordinal":0, "name":"MALE"},
      "verified" : false,
      "userImage" : "Rm9vYmFyIQ=="
    }
    thanks,

    Paulo Cordeiro
    Last edited by pscor; Apr 19th, 2011 at 07:28 PM. Reason: solved

  2. #2
    Join Date
    Jun 2009
    Posts
    9

    Default

    Hi,

    I solved my problem with a personal JsonSerializer class.
    Write a post in my blog http://goo.gl/JcVOC

    Paulo Cordeiro

Posting Permissions

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