There are 2 ways to validate an http request in OnePlatform:


The first is the status code, where we check if the request's return belongs to the family 200;


And the second is using the String Validation;


Here I bring a novelty, the string validation can also receive a regular expression.


"Regular expressions are character patterns that associate strings in text. We may use regular expressions to extract or replace portions of text, as well as address or link images in an HTML page, modify text format or remove invalid characters."


So you can make more complex checks, like the example below:


If your api's return is:


{

status: 1,

name: xyz

}


Any result for status other than 0 is considered valid, it would set the following String Validation:


status: [^0]


For more details on how to use Regular Expressions, you can check GoLang documentation:

https://golang.org/pkg/regexp/syntax/