Troubleshoot API requests
Diagnose contract-backed validation, lookup, authentication, and upload failures.
Match the HTTP status and operation description to the corrective action supported by the contract.
A request returns 400
- For pet and order lookups, confirm that the path identifier is an integer.
- For status searches, use
available,pending, orsold. - For login, check the supplied username and password.
- For image upload, include a binary request body.
A request returns 404
The requested pet, order, or user was not found. Confirm that the path value identifies an existing resource. For the sample order lookup, the contract recommends integer IDs less than or equal to 5, or greater than 10.
A request returns 422
The add-pet, update-pet, and place-order operations define 422 as a validation exception. Compare the request body with the data models, including the required Pet.name and Pet.photoUrls properties.
A secured operation fails
Check the operation's security requirement and send either the required bearer token or api_key header. Authentication maps both schemes to their operations.
An unexpected status appears
The contract defines a default Unexpected error response for every operation without specifying a status code or body. Capture the actual status and response locally; the published contract does not provide a more specific recovery procedure.
Next, return to the relevant endpoint page and compare every path, query, header, and body value with its parameter definition.