Validate responses
Validate Rules
Scope of Validation
JSON
, XML
, HTML
, Raw
, Binary
,No-Content
, MsgPack
, Event-Stream
JSON
and XML
can configure schemas. For detailed explanation of data structure, please refer Schemas.Validation Item | Property type | Validation Prompt Example |
---|---|---|
Required key existence | All | $ should have required property "code" |
Value type matches spec | All | $.data.id should be integer |
Non-null key must not have null value | All | $.data.id should be integer |
Enumerated value within range | String, Integer, Number | $.data.status should be equal to one of predefined values(Enums available, pending, sold) |
Numeric value within range | Integer, Number | $.data.id should be >= 0 |
Numeric value follows multiple requirement | Integer, Number | $.data.quantity should be a multiple of 10 |
String length within range | String | $.data.name should not be shorter than 3 characters |
String matches pattern | String | $.data.name should match pattern "^[A-Za-z]" |
Array element count within range | Array | $.data.tags should not have more than 2 items |
What to do next
Validating other responses
Validate Additional Properties
name
and phone
. Therefore, the data structure was specified like:
city
field was added to this API, but the API spec was not updated. According to default validation mechanism, no error will be reported, meaning that adding additional fields is allowed by default.
1.
object
, configure "additionalProperties" to "Deny", which will only take effect for the current API.2.
3.

Validation settings
Endpoint Cases
.

Validate Reponse Content
Endpoint Cases
.