【发布时间】:2016-12-23 06:40:04
【问题描述】:
我有一个 Java JSON 对象,它的格式是 [{a=b}],我试图将此对象作为 JSON 对象传递给 javascript,但它在键和值上都缺少 " 以及 "= " 而不是 ":"
有没有一种简单的方法可以将此 JAVA JSON 对象转换为可供不同服务使用?
事实证明,解析非常复杂,因为实际的 JSON 是嵌套的,并且缺少引号和嵌套指示。
“JSON”数据示例:
[{wwnType=Virtual,serialNumberType=Virtual,connections=[], modified=2016-10-29T19:00:04.457Z, macType=Virtual, category=server-profile-templates, serverHardwareTypeUri=/rest/server-硬件类型/32006464-D3C6-4B4E-8328-47A193C6116C,bios={overriddenSettings=[],manageBios=false},firmware={firmwareBaselineUri=null,manageFirmware=false,forceInstallFirmware=false,firmwareInstallType=null},boot={ manageBoot=true, order=[CD, Floppy, USB, HardDisk, PXE]}, hideUnusedFlexNics=true, bootMode=null, state=null, affinity=Bay, localStorage={controllers=[]}, type=ServerProfileTemplateV1, status= OK,description=,eTag=1477767604457/1,serverProfileDescription=test,name=test,created=2016-10-29T19:00:04.428Z,enclosureGroupUri=/rest/enclosure-groups/e989621b-930e-40e7-9db0-a6ddbf841709 , uri=/rest/server-profile-templates/db1dbdcc-4237-4452-acc3-cf9dfdc75365, sanStorage={manageSanStorage=false, volumeAttachments=[]}}]
谢谢
【问题讨论】:
标签: javascript java json parsing