gpt4 book ai didi

java - JSON请求修改

转载 作者:太空宇宙 更新时间:2023-11-04 10:41:58 25 4
gpt4 key购买 nike

我需要修改我的 JSON。我想删除 [] 之前的 "

当前请求:

{"marital-status":"Single","hospitalisation":"["hello", "world"]","ill-health":false,"specialist-condidtions":"["HEADACHE", "PANIC ATTACK"]","smoker":false,"health-concerns":false}

修改后的请求:

{"marital-status":"Single","hospitalisation":["hello", "world"],"ill-health":false,"specialist-condidtions":["HEADACHE", "PANIC ATTACK"],"smoker":false,"health-concerns":false}

我尝试使用翻译函数fn:translate(req,'"[','[')但这取代了我所有的 " 以及 [.

最佳答案

如果管道中有 XML,为什么不使用 NXSD 自动转换为 json。

要执行此操作,只要您有 JSON 的 XSD,然后只需使用 nXSD 组件,翻译就会自动发生?

https://svgonugu.com/2015/12/27/using-translate-activity-for-xml-to-json/

关于java - JSON请求修改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48879871/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com