How to Build Contract-Driven API Tests With OpenAPI and AI

Hi! I’m Oleg, a QA Engineering Manager focused on test strategy, automation, and AI-assisted QA workflows. This is a continuation of a series on where AI actually earns its place in QA — and this time the answer starts somewhere less glamorous than AI: with the OpenAPI spec. The short version: we generate a Java API client from Swagger, write tests against that generated client, measure coverage against the spec automatically in GitLab CI, and hand the resulting gaps to an LLM as a structured JSON report so it can write the missing tests.The problem: tests that drift away from the contractA very common failure mode in API testing is that tests live separately from the API contract. A QA
…