API contract testing from OpenAPI using Arazzo
Blog post from Redocly
A developer implemented a minor backend change that led to an API issue where a required field was dropped from the response, causing mobile app crashes despite tests and monitoring appearing normal. This scenario highlights the importance of API contract testing, which ensures that API responses match the OpenAPI specification by validating live responses against it. Respect, an open-source CLI tool, facilitates this by removing the need for separate test code and using the OpenAPI description as the source of truth. It works alongside Arazzo, which helps define multi-step workflows without custom code. Together, they allow for automated and straightforward validation of API contracts, catching issues like missing fields or incorrect status codes that traditional tests might miss. Respect CLI can be used locally or integrated into CI/CD pipelines, and the service can be extended into continuous monitoring for production environments, offering a robust solution to enforce API contracts and prevent unnoticed drifts.