如何在hash子4中将hashmap转换为正确的json格式?

问题描述 投票:2回答:2

我正在尝试记录我的哈希图,它看起来像这样:enter image description here

如何将其转换为正确的json格式?

java mule anypoint-studio dataweave
2个回答
1
投票

您可以使用Transform Component并按如下所示编写dataweave代码:

%dw 2.0
output application/json
---
payload pluck(message,property,index) -> {(index) :{(property) :message}}

这应该起作用。


0
投票

只需在流的末尾添加带有]的转换消息>

%dw2.0
application/json
---
payload
© www.soinside.com 2019 - 2024. All rights reserved.