OpenAPI, former known as Swagger, is a specification, usually expressed in JSON and YML, that describes how your API looks and behaves like. It’s a

OpenAPI for Contract Testing

submited by
Style Pass
2024-10-15 23:00:16

OpenAPI, former known as Swagger, is a specification, usually expressed in JSON and YML, that describes how your API looks and behaves like.

It’s a very powerful tool which I don’t believe is used as much as it should. Most people I have talked to think that it’s just a way to generate API documentation. I also remember talking to people who are not in love with OpenAPI because it gets outdated over time. People may change the API and forget to modify or re-generate the openapi spec. And voila! you have an OpenAPI spec which doesn’t even represent how your API actually behaves. Your API clients find that the OpenAPI spec you have is merely a representation of how your API looked at some point in the past and you are back to the old-fashioned way of sharing the details about your API via slack messages.

I am here to tell you that you can ensure your OpenAPI is never out of sync with how your API actually behaves. You could even take it few steps further and use it for contract testing.

Leave a Comment