openapi_first 2.8.0 will make it very simple to turn your existing integration tests into contract tests against an OpenAPI API description. No extra middlewares. No custom test assertions.
openapi_first 2.8.0 will make it very simple to turn your existing integration tests into contract tests against an OpenAPI API description. No extra middlewares. No custom test assertions.
Here is a discussion how the request validation middleware should handle paths that are not defined in your #openapi API description. – Return 404 or skip the validation and pass the request to the upstream app?
Your thoughts would be very much appreciated.
openapi_first 2.7.0 was released with better support for handling multiple APIs, including an RSpec integration, and an option to adjust the request path used for validation.
openapi_first 2.3.0 adds a new feature: API coverage testing
It checks if all requests/responses that are defined in your API description have been called during your test run. This is a key feature to avoid API drift.
Please check it out: https://github.com/ahx/openapi_first?tab=readme-ov-file#contract-testing
I just released version 2.0.3 of openapi_first, which makes the test assertion method work as described and adds an option to the request validation middleware to skip the error response. This option can be useful in a code-first scenario where you want to subscribe to invalid requests / responses according to your API description.