API Testing error

Error: JSON schema validation failed: instance.price is not of a type(s) number

The response body doesn't match the contract your test expects, because the API is returning a different shape or type than the schema declares.

Why this happens

How to fix it

  1. Confirm which side is wrong: check the actual raw response body against what the schema declares, don't assume the API is at fault
  2. If the API intentionally changed, update the schema as part of that PR, not as an afterthought when tests start failing
  3. Model optional/nullable fields explicitly in the schema instead of assuming every field is always present