---
author: Cody Reichert
title: Sync changes from OpenAPI/Swagger specifications with Assertible API tests
description: Assertible has been working hard on building a solution to automatically create API tests from an OpenAPI or Swagger specification. We're taking this a step further to make it possible to sync changes from a specification with Assertible to make maintaing your test suite a breeze.
image: https://s3-us-west-2.amazonaws.com/assertible/blog/assertible-openapi-sync.png
category: featured
date: 02/11/2019
---
> Automated API testing with an OpenAPI or Swagger specification just
> got a lot easier with Assertible's new _sync_ feature. Read below to
> learn about how it works and how to get started today.
Generating automated tests for your API from an OpenAPI specification
has historically been a difficult task. Keeping tests in sync with
changes to a spec was even more tedious. These are the big problems
we're working on at Assertible and **today we're excited to announce
our newest feature: sync**.
Sync allows you to **update your Assertible tests when your spec
changes**. That's right! You no longer have to manually update your
tests after adding new parameters or changing the response of your
API. Here's a few things we'll go over in this post:
1. [What is sync, and how does it work?](#what-is-sync-and-how-does-it-work)
2. [What data gets synced?](#what-data-gets-synced)
3. [Can I use this today?](#can-i-use-this-today)
4. [What's planned for the future?](#whats-planned-for-the-future)
## What is sync, and how does it work?
When you get started with Assertible, you can
[import an OpenAPI or Swagger specification](/blog/testing-an-api-using-swagger)
to generate API tests. Now, after you make changes to your spec,
**sync will propogate those changes to all of your Assertible tests**.
Here's a few scenarios where this is useful:
- A _response body_ is updated with a new or removed field.
- A _query parameter_ is added or removed from an operation.
- A _new endpoint or method_ is added to your API.
In all of these cases, sync will save you from doing manual work to
update your tests. Using algorithms to detect _unique operations_,
Assertible is able to **determine which tests need to be updated**.
This means that sync will work even if you have multiple tests for the
same operation. Check out the docs for [more on how sync works](/docs/guide/sync).
## What data gets synced?
Assertible tries to import as much information as possible from your
specification, like the `endpoints`, `methods`, `variables`, and more.
**This same data is checked for changes during sync**. When changes
are detected, they are applied to the applicable tests.
Several fields are checked during import and sync _(see the
[full list in the docs](/docs/guide/sync#openapi-import-fields))_:
- Test name (using the `summary` field)
- Endpoint
- HTTP Method
- Path variables
- Query parameters (_optional and required_ parameters)
- Request headers (_optional and required_ headers)
- Sample request body data
- Response body schema (_JSONSchema assertions_)
This is particularly useful when changes to the response body for an
operation are changed. Assertible **creates and updates JSONSchema
assertions** for your API responses, making it trivial to test the
latest version of your API.
[Learn more about syncing your OpenAPI, Swagger, or Postman specification](/docs/guide/web-services#importing-a-swagger/openapi-spec).
## Can I use this today?
Yes! **Sync is available for everyone** and you can use it today. This
has been one of our most highly requested features, so please try it
out and let us know what you think
[on Twitter](https://twitter.com/AssertibleApp) or by
[sending us a message](/contact).
#### How to use sync
Sync is the default behavior when importing new tests from an
[OpenAPI or Swagger spec](https://www.openapis.org/) to an existing
service. After you've [created your web service](/docs/guide/web-services),
your spec can be synced from the **Import new tests** page:
On this page, you can import your specification from a URL or by
uploading a file. Assertible will show a **preview of all the new and
existing tests found in the spec**. New operations will show a
star icon: .
Existing tests will show a sync icon:
.
That's all you need to do! **Confirm the import and Assertible will
create and update your API tests**. You can also choose to sync only
specific operations, and optionally run all of your tests after the
update.
## What's planned for the future?
**Sync takes care of a ton of use-cases, and makes everyones job
easier**. But there's still many things we want to do, and we want to
hear what features you need - [message us](/contact)! We're constantly
coming across new use-cases, so your input is valuable. Here's the
next few things we have in the pipeline:
- **Automatic syncing** for hosted specifications (e.g., from a URL or
in a GitHub repository).
- **Automatic versioning** of specifications on GitHub that change in
commits or pull requests.
Supporting these workflows will be a huge improvement to testers and
developers in charge of keeping the tests up to date and ideally
provide a **fully automated solution** that requires **minimal
intervention**. [Sign up for a free accout](/signup) and try out sync
today!
:: Cody Reichert