/
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 |
---|---|
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
} |
, multiple selections available,
Related content
Payload JSON Replace (payload:json-replace)
Payload JSON Replace (payload:json-replace)
More like this
Payload JSON (payload:json)
Payload JSON (payload:json)
More like this
Payload JSON Read (payload:json-read)
Payload JSON Read (payload:json-read)
More like this
Payload JSON Get (payload:json-get)
Payload JSON Get (payload:json-get)
More like this
Payload XML Remove Tag (payload:xml-remove-tag)
Payload XML Remove Tag (payload:xml-remove-tag)
More like this
Payload JSON Add (payload:json-add)
Payload JSON Add (payload:json-add)
More like this