Jettison
  1. Jettison
  2. JETTISON-92

Multiple collections in an object get collapsed into one JSON array

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.1, 1.2
    • Fix Version/s: 1.3.3
    • Labels:
      None
    • Environment:
      Linux, JBoss
    • Number of attachments :
      0

      Description

      Consider the following class:

      @XmlRootElement(name="moduleLinks")
      public static class ModuleLinkSet

      { @XmlElement(name="installation") Collection<Installation> installations; @XmlElement(name="module") Collection<Module> modules; }

      Given an object of this class where installations contains two objects that serialize to

      {id:1}

      and

      {id:2}

      , and modules contain two objects that serialize to

      {id:3}

      and

      {id:4}

      , I was expecting a JSON serialization like

      {
      moduleLinks: {
      installation: [

      {id:1}

      ,

      {id:2}

      ],
      module: [

      {id:3}

      ,

      {id:4}

      ]
      }
      }

      What I actually get is

      {
      moduleLinks: {
      installation: [

      {id:1}

      ,

      {id:2}

      , {module:{id:3}}, {module:{id:4}} ]
      }
      }

      This looks very wrong to me.

        Activity

          People

          • Assignee:
            Sergey Beryozkin
            Reporter:
            Lars Clausen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: