XStream
  1. XStream
  2. XSTR-531

add an option to hide system attributes (e.g. the class name) in the json

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.2
    • Fix Version/s: 1.3.1
    • Component/s: IO
    • Labels:
      None

      Description

      Box has a list of Product
      public class Box {

      private Integer id;

      private String name;

      private List<Product> products = new ArrayList<Product>();

      // getters and setters
      }

      I serialize the box instance to json, the result is
      {"box":{"id":"1","name":"box1","products":{"product":[

      {"id":"1","name":"product1","price":"11.0"}

      ,

      {"id":"3","name":"product3","price":"33.0"}

      ]
      }}}

      but what I want is( without alias of class name: "box" , "product")
      {"id":"1","name":"box1", "products": [

      {"id":"1","name":"product1","price":"11.0"}

      ,

      {"id":"3","name":"product3","price":"33.0"}

      ]
      }

      The tree of Ext requires the latter form

      So if possible, please provide a option to hide the class names, thanks

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Daniel.Sun
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: