Reputation: 11
problem:
$ | not equal | match failed for name: 'httpCode' (MAP:MAP)
$.httpCode | data types don't match (STRING:NUMBER) '#number' 206
schema:
response
{"httpCode":206,"httpMessage":"PARTIAL_CONTENT",
how to validate schema with "#number"??
Upvotes: 1
Views: 185
Reputation: 58058
It is clear from the error message that the 206
in your actual response JSON is a string, not a number. If you are right, there is a serious bug in Karate, so please follow this process: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue
More likely though, your question is incomplete.
To prove Karate behavior, try this simple test:
* def response = { httpCode: 206 }
* match response == { httpCode: '#number' }
You can change 206
to '206'
and see the difference.
Upvotes: 1