Public | Automated Build

Last pushed: 4 months ago
Short Description
Swiss-army knife for API testing
Full Description

Swiss-army knife for API testing

This image is designed to test an API using a Swagger file.
Actually that image includes the next tools:

Docker image chain

This image extends from apiaryio/dredd:2.1.0 which it's generated using an ultralight node image from mhart/alpine-node:4.4, who uses an Alpine 3.4.
If you need to add more dependencies, make sure to take a look at mhart/alpine-node Github repo.


Convert Swagger 1.2 to Swagger 2 version

$ docker run --rm -v `pwd`:`pwd` -w `pwd` ferrastas/apidoc-utils api-spec-converter -f swagger_1 -t swagger_2 ./swagger1.json > swagger2.json

Run tests against our local instance

$ docker run --rm -v `pwd`:`pwd` -w `pwd` ferrastas/apidoc-utils dredd ./swagger2.json http://api.test

Using in a Symfony2 project

If you are considering to use a Symfony bundle to generate the documentation (NelmioApiDoc supports Swagger 1.2 format) you must take in consideration that Dredd only supports Swagger 2.0 and API Blueprint. (Check out Usage section to convert Swagger 1.2 file to Swagger 2.0)

It also exists several framework-free libraries such as Swagger-PHP, if you are considering to migrate from NelmioApiDoc to Swagger-PHP, please take a look at this blog post.

Dredd Hooks

This image includes PHP 5.6 to be able to run Dredd PHP Hooks, make sure that your project includes dredd-hooks-php running next command.

$ composer require ddelnano/dredd-hooks-php --dev
Docker Pull Command
Source Repository