无法将我的scala对象与ArrayBuffer转换为JSON

时间:2016-05-05 08:56:52

标签: json scala

我的Scala对象

class Product(@BeanProperty var productName: String,
    @BeanProperty var source: String,
    @BeanProperty var category: String,
    @BeanProperty var comments: ArrayBuffer[String]) {

}

使用Jackson API

 val p = new Product("","","",list with 1000 values) 
 var objectMapper = new ObjectMapper
    println(objectMapper.writeValueAsString(p))

输出:

"productName":"Apple iPhone 6","source":"dump_gsm_arena","category":"Mobile","comments":**{"empty":false,"traversableAgain":true}**}

使用Play和JsonLift Api获得相同的结果

0 个答案:

没有答案