WireMcok cloud supports versioning of your mock APIs. This means that as you create and configure your mock APIs, a
version history is kept for each API. This allows you to easily revert to a previous version of your API, or to
compare the differences between two versions.
The version history for your mock API is availabla on the mock API menu bar. Click on the Version history link to
access the version history.This will take you to the version history page for your mock API where you will be able to see a list of the most recent
commits.
A commit is a collection of changes to your mock API and is created when you create, modify or delete assets
associated to your mock API - stubs, settings, GraphQL schemas, gRPC definition files, OpenAPI schemas, etc.Each commit will have a timestamp of when commit was made to the API. If the commit is made by an authenticated user
(as opposed to the system), the user’s username will be displayed alongside the commit.
Changes are the individual changes that were made to your mock API. To view the changes associated with a commit, click
on the View changes link to the right of the commit. This will display one or more changes highlighting what was
changed and how. For example, the following example shows a change for a stub creation in the Mock API:
You can click on any of the changes in the list to view the actual changes that were made. Where possible, this will
show you the diff highlighting what was added or removed..In the above example, the left side of the diff shows the stub before the change was made (it didn’t exist so this is
empty), and the right side shows the stub after the change was made. (All the stub is marked as ‘green’ because it was
created in this change)The diff view is available where we have a text representation of the change. For binary Mock API assets,
(like gRPC descriptor files) changes to those files are recorded but the diff view is not available.
The buttons above the diff shows the restore actions you can take on either side of the diff.In the example below, the right side of the diff has no action available because it shows the most recent
version of the stub. The left side of the diff has an action available to restore the change. Because this change
shows a stub creation, the ‘restore’ action is to delete this stub.Clicking on the Delete button will display a confirmation dialog asking if you want to proceed with the deletion.Clicking the No button will exit the confirmation dialog without deleting the stub. Clicking the Yes button
will ‘restore’ the change and delete the stub.Once you have deleted a stub, the stub will no longer be available in your mock API and a new commit will be created
with the stub deletion. The diff will show the stub as being deleted:You will see the button has now changed to Restore to allow you to restore the stub. Clicking on the Restore
button will display a confirmation dialog asking if you want to proceed with the restore.As before, clicking the No button will exit the dialog without restoring the stub. Clicking Yes will restore the
stub and create a new commit with the stub creation.The same applies to modifying - a new commit will be created with the change. The diff will show the change from the
previous version to the new version:You will notice in the image above that no Restore button is available on the right hand side of the diff. This is
because the right hand side of the diff shows the most recent version of the stub. The left hand side of the diff has an
Restore button available to restore the change. If the commit you were looking was not the most recent version of the
stub, you will see a Restore button on both sides of the diff allowing either side of the diff to be restored:Versioning is available for mock API stubs, settings, chaos, GraphQL schemas, gRPC definition files and OpenAPI schemas. Updating
any of these assets will create a new commit. Some commits are created automatically for you.
For example, if you are working on a REST mock API and you have automatic generation of OpenAPI to
stubs enabled. Updating a stub will create a new commit for the change to the OpenAPI and a new commit for the change to
the stub.
Importing into your mock API can generate multiple changes in the one commit. For example, if you imported a file that
created multiple stubs, each of those stub creation changes will be recorded in a single commit.
When you click on the View changes link for a commit, you will see the changes between the commit you have selected
and the previous commit. This is great for when you want to cherry-pick specific changes and restore individual items
in your mock API.However, if you want to restore the entire mock API to a previous version, you can do so by clicking on the Compare with latest
link next to a commitThis will show you all the changes between the current version of the mock API (the latest commit) and the commit you
have selected. You can then click on the Restore all changes button next to the commit you want to restore to.As with and restores, this will create a new commit with all the mock api changes from the selected commit. This will
include any changes to the mock API settings, stubs, chaos, GraphQL schemas, gRPC definition files and OpenAPI schemas.When you click on the Restore all changes button, you will be prompted to confirm that you want to restore the entire
mock API to the selected commit.Clicking Yes will restore the entire mock API to the selected commit and clicking No will exit the confirmation dialog
without making any changes.
You can read more about plan limits here.If you have feedback or questions on our Versioning functionality as it evolves, we’d love to hear from you.
Please get in touch.