SpecSentinel CLI Tool Catches API Spec Drift by Testing Live Endpoints
A developer built SpecSentinel, a command-line tool that compares a live API's actual responses against its OpenAPI specification to detect discrepancies. The tool sends GET requests to a running API, validates responses against the spec, and returns exit codes indicating a match, drift, or failure, making it suitable for CI pipelines. When tested against the public Swagger Petstore, it found that the GET /user/login endpoint returns plain text despite being documented as JSON, and three endpoints returned 500 errors covered only by a default response. Version 0.2.0 adds checks for string formats, number ranges, required response headers, JSON output, and a GitHub Action integration. The tool is available via pip and has been validated against large public specs from Petstore, GitHub, and Stripe without generating false positives.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in