Special Characters in JSON cause failure in custom MetadataSchema Form

Avatar

Avatar
Validate 10
Level 2
Rob_Curran__T4G
Level 2

Likes

6 likes

Total Posts

46 posts

Correct reply

3 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 2
Rob_Curran__T4G
Level 2

Likes

6 likes

Total Posts

46 posts

Correct reply

3 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Rob_Curran__T4G
Level 2

24-06-2016

Can someone confirm if this is a defect or a work-around for the following special characters issue?

Created a new MetadataSchema and added a Dropdown object when building the form.

The issue is that if you source the values for the drop-down from a JSON object (set the JSON Path in the field settings) then if the JSON contains certain special characters it causes the form to fail.

If the JSON source contains a slash (/) or a colon (:) in the text property then the slash causes it to create corrupt nodes under the form.  The colon causes it AEM to throw a namespace exception.  (Sample JSON below).

Why is the text property being "evaluated" in this way?  It prevents you from using these characters in the dropdown options which is a reasonable requirement.

NOTE:  Additionally, to use a JSON source like this requires you to set the JSON Path, save the form, reopen the form, then resave before the JSON options are reflected in the Metadata Form. 

 

// Rights Management { "options": [ { "value": "royalty_free", "text": "Royalty / Free" }, { "value": "rights_managed", "text": "Rights:Managed" }, { "value": "restricted", "text": "Restricted" } ] }

Replies

Avatar

Avatar
Validate 1
Level 2
aaront75403218
Level 2

Like

1 like

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
aaront75403218
Level 2

Like

1 like

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
Applaud 5
View profile
aaront75403218
Level 2

28-07-2016

Rob,

Can you tell me what path you put in for the JSON Path field and how you placed the JSON file in AEM? I saw the JSON Path field today and I'm not sure how to use it.

Avatar

Avatar
Level 1
ankit19
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
ankit19
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile
ankit19
Level 1

14-01-2019

Did you figure it out ? I have the same problem.

Avatar

Avatar
Level 1
ankit19
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
ankit19
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile
ankit19
Level 1

15-01-2019

Couldnt figure it out but used Jackson seralizer/desearlizer instead of Gson and it worked fine for my work