I'm using Karate to validate an endpoint answer. And my API is answering with a key-value structure. The problem is the value could be a boolean or a string.
How can I validate this with only one expression this OR with Karate?
Answer example:
{
"value": true,
"key": "key1"
},
{
"value": "This is my value",
"key": "key2"
}
I tried things like
onfStructure: "#? _ == ^*(confStructure1 || confStructure2)"
confStructure1:
value: "#boolean"
key: "#string"
confStructure2:
value: "#string"
key: "#string"
or
confStructure: "#? _ == (^*confStructure1 || ^*confStructure2)"
or
confStructure:
value: "#(^*newSchema)"
key: "#string"
newSchema:
value: "#boolean"
value: "#string"
But nothing is working.