-
Notifications
You must be signed in to change notification settings - Fork 220
Upcoming breaking changes
This page is to be used to communicate upcoming changes we intend to introduce to Hoverfly as well as how these new features will impact usage of Hoverfly.
If you have any concerns, questions or feedback regarding any of the changes listed below, please get in contact with us using either Github Issues or by posting in Gitter.
#v0.9.0 The key focus of v.0.9.0 is to consolidate. The past several months we've introduced several new features and new data schemas to back these features. Pre v0.9.0, all of these schemas are slightly disparate and make it more complicated to share and import simulations.
##Schema consolidation In v0.8.1, we introduced a change to the /api/records and the JSON schema, the schema used for importing and exporting data. We changed requests to include a request type field meaning we could have both recordings and templates in the same schema. Now that templates are included in this schema, we want to deprecate the /api/templates endpoint. We believe that all Hoverfly data should exist together. The benefits of this mean that it becomes easier to import all required data to run a simulation as well as making it easier to view and review simulations you have produced.
With that logic, we also plan to remove the /api/delays endpoint and move delays into the same JSON schema that recordings and templates exist in. With this done, Hoverfly will only need one payload.
##Delays As well as moving delays into the combined schema, we also plan to make changes to delays. ###Change to schema The JSON schema originally introduced for this feature was fairly minimal and did not conform to the other JSON schemas being used at this time.
{
"data": [
{
"httpMethod": "POST",
"urlPattern": ".\/api",
"delay": 2000
}
]
}
This schema is inconsistent. It does not use the same fields as recordings or templates.
The schema we are suggesting for v0.9.0 follows the template schema with optional fields.
{
"data": [
{
"method": "POST",
"path": "/api",
"delay": 2000
}
]
}
###Replacing regex Another change we intend to make regarding delays and Hoverfly is removing Regex. It is our opinion that Regex isn't always the easiest to work with. The feedback we have received has been people being unsure if their Regex delays are working.
Recently, we introduced a much simpler style of matching to request templates in which you could substitute any number of characters with a UNIX style * wildcard. We feel that this is the most user friendly way to substitute characters.
{
"data": [
{
"method": "POST",
"path": "/api/*",
"delay": 2000
}
]
}
##Versioning schema Currently, the /api/records endpoint will take a JSON payload with an implied schema. As we have been trying to simplify Hoverfly data and merge all the different types together, we've become increasingly more aware of the fact that these are breaking changes.
To mitigate this, we want to include a versioning system into the Hoverfly data schema. This way we will be able to safely make changes to the schema, provide clear documentation for each version of the schema and also have a more clear strategy of how we introduce new data into the schema while also allowing the newest versions of Hoverfly to provide some level of backwards compatibility with older schemas.