0

I have 2 scenarios.

request body:

 {
    "id"="",
    "name"="Jane"
 }

Expected result:

"Success"

request body:

 {
    "id"="323",
    "name"="Jane"
 }

Expected result: "id field should be emptied."

San
  • 307
  • 1
  • 3
  • 18

1 Answers1

1

this following dataweave will help you achieve what you are looking for

%dw 1.0
%output application/json
---
{
    output: 'Success' when 
    payload.id == null or payload.id == "" 
    otherwise 'id field should be emptied.'
}

enter image description here

enter image description here

satish chennupati
  • 2,602
  • 1
  • 18
  • 27