API Testing / Scenario
When the Spec and the Server Disagree
An OpenAPI spec says one thing, the running API says another. Diff them and design the CI gate that catches drift.
- Difficulty
- Hard
- Format
- Scenario
- Points
- 200
- Estimate
- 16 min
// MISSION BRIEF
Your Mission
The team has a beautiful OpenAPI spec. It just does not match the API anymore. A field the spec calls a number comes back as a string; a required field is missing; an undocumented field appeared.
Compare the response to the contract, then design the automated check that would have failed the build the moment they drifted apart.
// FIRST CONTACT
Battle teaser
First artifact
OpenAPI spec: GET /products/{id} response schema
Comparing the response to the documented contract, which responses do NOT conform? (Select all that apply.)
- Aid is an integer matching the schema
- Bprice is documented as a number but returned as a string
- Crequired field in_stock is missing entirely
- Dinternal_cost is present but undocumented (drift from the spec, and possibly a data leak)
Answers, scoring, hints, and the full battle stay sealed.
// SKILL TAGS
apiopenapicontract-testingci