Layer 7 API Management

Policy Repository: Sanitize JSON Body of special characters 

10-15-2018 09:00 AM

Sometimes it may be necessary to remove special, non alpha-numeric characters, from JSON values. This policy uses a combination of RegEx and JSON path expressions to accomplish this.

 

I.e:

{
"value": "This is a test message ' with special characters $30"
}

 

To use:


1) Open Policy Manager
2) Use an existing service or create a new service
3) Click the Import Policy button and browse to the sample policy

 

For testing/demo purposes the JSON payload is stored within a message variable,'payload'. This can be customized to another source (request / response) as needed.

Statistics
0 Favorited
1 Views
1 Files
0 Shares
0 Downloads
Attachment(s)
zip file
Sanitize JSON.xml.zip   1K   1 version
Uploaded - 05-29-2019

Tags and Keywords

Related Entries and Links

No Related Resource entered.