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
- A backend change altered a field's type or shape without updating the shared contract/schema
- The schema itself is stale relative to the actual API
- A conditionally-present field is `null`/missing in this particular response and the schema doesn't account for that
How to fix it
- Confirm which side is wrong: check the actual raw response body against what the schema declares, don't assume the API is at fault
- If the API intentionally changed, update the schema as part of that PR, not as an afterthought when tests start failing
- Model optional/nullable fields explicitly in the schema instead of assuming every field is always present