Validating openapi 3.0 API description against backend implementation of the API in Loopback 4

261 Views Asked by At

I tried Dredd but it's not working with openapi spec 3.0 that is generated by Loopback 4 framework.

I wanted to know what are the options available for this type of testing where I want to validate the openapi 3.0 API description against backend implementation of the API.

Any alternative for Dredd that provide similar functionality but works for openapi 3.0 ?

1

There are 1 best solutions below

0
Stranger6667 On

Any alternative for Dredd that provide similar functionality but works for openapi 3.0 ?

You could take a look at Schemathesis. It verifies all examples specified in the schema (even partial, in contrast to Dredd) and uses property-based testing to generate tests and verify that everything declared in the schema matches the backend implementation. It checks response status code, content-type headers, and response schemas. It supports both Open API 2 and 3.

It has a CLI and could be extended with various hooks to fit the desired workflow.