vaccine
is a command line application to test your REST APIs against complex patch requests.
Often as the number of elements of a REST resource increases, the validation rules for patching it become more complex, to the point where hard to find bugs are introduced because of the increasing number of combinations of these elements which might appear in a patch request.
vaccine
ingests a JSON formatted schema of your REST API endpoints, and uses it to do two things:
- It creates an object graph according to your schema.
- It then sends randomized patch payloads to the endpoints representing these objects.
The randomized payloads contain two levels of randomness:
- Elements to be part of the payload are selected at random
- The values of these elements are then randomized
For example, given the following resource:
{
"name": "Jumbo",
"species": "elephant",
"weight_in_lbs": 1000.09,
"carnivorous": false
}
The patch payload generated will contain combination of these elements with random values for each element.
The responses for the patch requests are recorded when server error is encountered.
The object graph is built by POST
ing the full payload from your schema, using default_value elements
that you define in the schema. Before building a given object all of its dependencies are built first.
The following data types are supported:
- String
- Number
- Float
- Boolean
- Datetime
- Nested JSON objects
Lists are planned to be added.
Vaccine is tested against castles