Layer 7 API Management

Policy Repository: Concatenate JSON 

07-26-2018 09:30 AM

A simple policy demonstrating how to concatenate two JSON strings. The policy utilizes RegEx to pull the key/value pairs (removing the curly braces).

 

A source variable is set to the below. 

 

{
"user4": "Bill",
"user5": "Mo",
"user6": "Greg"
}

 

This policy will add the above JSON to the existing JSON

 

{
"user1": "Joe",
"user2": "Alec",
"user3": "Matt"
}

 

Resulting in:

 

{
"user1": "Joe",
"user2": "Alec",
"user3": "Matt",
"user4": "Bill",
"user5": "Mo",
"user6": "Greg"
}

Statistics
0 Favorited
5 Views
1 Files
0 Shares
1 Downloads
Attachment(s)
zip file
concat_json.xml.zip   673B   1 version
Uploaded - 05-29-2019

Tags and Keywords

Related Entries and Links

No Related Resource entered.