You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by asub927 March 23, 2023
I need to validate an api which has a response property which returns string or empty or null values based on the data in the backend.
Initially tried with string() matcher which fails when the property value returns empty or null
then tried oneOf() matcher which also fails when the property value returns string()
works when I use any() but I want to match specific to the allowed data types
Code sample for reference. Any help to handle this condition is greatly appreciated.
Discussed in #267
Originally posted by asub927 March 23, 2023
I need to validate an api which has a response property which returns string or empty or null values based on the data in the backend.
Code sample for reference. Any help to handle this condition is greatly appreciated.
_spec
.get(/api)
.expectStatus(200)
.expectJsonMatch({
property: oneOf([string(), "", null])}
The text was updated successfully, but these errors were encountered: