/
Payload JSON Remove (payload:json-remove)

Payload JSON Remove (payload:json-remove)

“The payload:json-remove helps you remove a tag from an existing json file.”

Usage:

<payload:json-remove path=""!/>

! -mandatory

Example

Example

Behaviour

Example

Behaviour

Remove the “title” tag and it’s value from the second book.

 

<payload:file method="content" name="jsonContentFromFile" path="/assets/bookstore.json"/> <payload:json-read name="jsonPayload" method="read" jsonString="${jsonContentFromFile}"> <payload:json-remove path="store.book[1].title"/> </payload:json-read>
{ "category":"fiction", "author":"Evelyn Waugh", "price":12.99 }

Remove the “title” tag and it’s value from all of the books.

 

 

 

 

 

 

 

 

 

<payload:file method="content" name="jsonContentFromFile" path="/assets/bookstore.json"/> <payload:json-read name="jsonPayload" method="read" jsonString="${jsonContentFromFile}"> <payload:json-remove path="store.book[*].title"/> </payload:json-read>
{ "store":{ "book":[ { "category":"reference", "author":"Nigel Rees", "like":false, "price":8.95 }, { "category":"fiction", "author":"Evelyn Waugh", "price":12.99 }, { "category":"fiction", "author":"Herman Melville", "isbn":"0-553-21311-3", "like":true, "price":8.99 }, { "category":"fiction", "author":"J. R. R. Tolkien", "isbn":"0-395-19395-8", "like":false, "price":22.99 } ], "bicycle":{ "color":"red", "price":19.95 } }, "expensive":10 }







Related content