내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

issue with json data for composite field in content fragment

Avatar

Level 1

Implemented composite multifield.

http://experience-aem.blogspot.com/2018/10/aem-6420-assets-content-fragments-coral-3-composite-multi... 

 

Need the array to be json array than string array.

 

issue json coming as String Array

0 "{\"linkName\":\"test\",\"linkUrl\":\"test\"}"
1 "{\"linkName\":\"test\",\"linkUrl\":\"test\"}"

 

expected as json array as below.

0 {\"linkName\":\"test\",\"linkUrl\":\"test\"}
1 {\"linkName\":\"test\",\"linkUrl\":\"test\"}

1 답변 개

Avatar

Community Advisor

Hi @O703980 

 

The String Array that you have mentioned is a valif JSON whereas the expected JSON array you mentioned is not a valid JSON.

 

do you mean by:

[{\"linkName\":\"test\",\"linkUrl\":\"test\"}, {\"linkName\":\"test\",\"linkUrl\":\"test\"}]

to 

"[{\"linkName\":\"test\",\"linkUrl\":\"test\"}, {\"linkName\":\"test\",\"linkUrl\":\"test\"}]"

 

If that's the case you can use the Gson API.

 

String x = input;
Gson gson = new Gson();
String toJson = gson.toJson(x);