I was trying to accept multiple values including empty in Mountebank predicates.
As per below in the query parameter I want to accept both false and empty value.
Tried below and it doesn't accept neither isValid=false
nor isValid=
"predicates":[
{
"matches":{
"method":"GET",
"path":"/accounts",
"query":{
"isValid":"/false|^null$/"
}
}
}
],
"responses":[
{
"....."
}
]
I tried below option as well as per this
"isValid":"/false.^null$|^null$.false/"
You need to use
Here,
^
- matches start of string(?:false)?
- an optional (due to?
at the end) non-capturing group that matches a char sequencefalse
one or zero times$
- end of string.