Hello i have trouble in "absent" field. to check i...
# help
s
Hello i have trouble in "absent" field. to check if
exist
field inside the
auth
object but when i pass the below pattern in mapping then it should point to different file but it is not doing - for both true and false it is going to same file, that is because it always maps to the same mapping irrespective i give
true
or
false
im using gradel deps --> implementation "com.github.tomakehurstwiremock jre8 standalone2.35.1
Copy code
"bodyPatterns": [
  {
    "matchesJsonPath": {
      "expression": "$.auth.exist",
        "absent": "false"
    }
  }
]
i have stopped relying for absent on negative confirmation (ensure
field
is present) - only using
absent
for positive confirmation ( ensure
field
is not present). like below instead of using
absent
equals
false
Copy code
"bodyPatterns": [
  {
    "matchesJsonPath": {
      "expression": "$.auth.exist",
        "absent": "true"
    }
  }
]

or

"bodyPatterns": [
{ "matchesJsonPath": "$.auth.exist"}
]