0
我有JSON的格式如下:反序列化JSON与JSON4S
{
"id": 1913548255,
"notification": "NotificationReceived",
"deviceGuid": "e60d6085-2aba-48e9-b1c3-73c673e414be",
"timestamp": "2016-01-28T20:34:34.167",
"parameters": {
"jsonString": "{\"mac\":\"bc6a29abd973\",\"uuid\":\"f000aa1104514000b000000000000000\",\"value\":0.27328648477047685}"
}
}
我想反序列化得到以下类,使:
case class Parameters(mac: String, uuid: String, value: Double)
case class Notification(id: BigInt, notification: String, deviceGuid: String, timestamp: String, perameters: Parameters)
我知道我需要写CustomSerializer
。但我没有太多经验。请引导我。感谢帮助。