microcks / microcks

The open source, cloud native tool for API Mocking and Testing. Microcks is a Cloud Native Computing Foundation sandbox project 🚀
https://microcks.io
Apache License 2.0
1.41k stars 222 forks source link

Adding Swagger (aka OpenAPI v2) support for contract definition #584

Closed lbroudoux closed 2 years ago

lbroudoux commented 2 years ago

From the origin, we do not support Swagger (aka OpenAPI v2) standard in Microcks as Swagger was incomplete and does not allow specifying full examples and request/response mapping. Especially:

So from the start we supported OpenAPI v3 that does not have these limitations. And that was a nice fit for us as Microcks followed the 1 artifact == 1 API mock definition principle.

However we did get feedback from the community and now are convinced that this approach can be too restrictive sometimes. A use-case that is emerging is that some people may have a single OpenAPI file containing only base/simple examples but are managing complementary/advanced examples using, for example, a Postman Collection. As a consequence, we implemented the Multi-artifacts support in release 1.3.0.

Thus we used this new feature to add gRPC support and GraphQL support to newer releases of Microcks.

The thing we didn't think about at that time is that Multi-artifacts support could also be leveraged to finally support Swagger v2 in Microcks! Allowing you to reuse your Swagger v2 contracts and related Postman Collection to have direct mocking and contract-testing within Microcks.

So here we are... ready to finally add this support! Please vote for this issue if you want to raise priority on it!

lbroudoux commented 2 years ago

Now available !!