Syncing makes it easy to keep your Assertible tests up-to-date with the latest changes in OpenAPI, Swagger, and Postman API specification documents.

For teams that maintain API definitions in OpenAPI, Swagger, or Postman collection format, a pain-point is often keeping tests up-to-date with the latest changes in the spec. To solve this problem, we've implemented sync.

Learn more below about how it works and getting started:

HTTPBin Swagger Spec synced tests

Syncing a specification

Tests can be synced in two ways:

Syncing tests from a new import

When you import new tests on an existing web service, Assertible will look for any previous imports from the same specification. This is useful if you are importing your spec from a file or want to sync only certain tests:

Syncing OpenAPI specification with Assertible tests

Syncing tests from an existing import

When you import a specification from a URL, Assertible saves that information and so you can easily sync with the specification hosted on that URL at the click of a button. A list of these available imports can be found on the Imports tab of your web service's Settings page:

Sync / re-import tests

How sync identifies unique operations

It's important to understand how Assertible uses the information in your import source to identify and import unique tests so that you can use the full power of sync to your advantage.

Assertible iterates through each unique definition (Operation for OpenAPI/Swagger and Item for Postman Collections) in your spec and creates or updates tests based on two distinct processes:

  1. Identify a unique determinstic key for the test

    For OpenAPI/Swagger definitions, each unique METHOD/ENDPOINT combination (or Operation) is defined as a unique Assertible test. This behavior can be overriden using operationId. See the section below on syncing OpenAPI/Swagger documents for more details.

    For Postman Collection definitions, each unique collection Item is defined as a unique Assertible test. This behavior can be overriden using Item's id parameter. See the section below on syncing Postman collections for more details.

  2. Map data and populate your Assertible test from your unique spec item

    Assertible uses as much information as possible to intuitively use the information from your spec to configure as much test and assertion data as possible. Unintrusive defaults that are the most likely to result in a successful test run with the least necessary configuration are used when possible.

    See the respective sections for OpenAPI, Swagger, and Postman below for a comprehensive guide on what fields in a spec map to Assertible test configuration values.

NOTE The steps above are applied to imported tests regardless of whether you are importing from a new spec or syncing an existing spec from a URL. See the sections below for a way to override this behavior dependending on the type of spec you are importing.

Syncing OpenAPI or Swagger definitions

By default, when you import an OpenAPI or Swagger definition Assertible creates a test for each unique Operation. In practice, this is determined using the ENDPOINT/METHOD as the key for each test.

In practice, this means that if you change the operation's method from GET to PUT in your spec, Assertible will create a new test and sync that for all future imports.

Configuring the operationId field on your item will override Assertible's default unique test identification, giving you complete control over all future updates to a specific test.

OpenAPI import fields

See the legend below for references to OpenAPI documentation

Assertible field OpenAPI field Default
endpoint The key of the Paths entry [0] n/a
method The key of the Path Item key [1] n/a
name The summary value for the Operation [2] Combination of operation and path name
description The description value for the Operation [2] null
variables For each Parameter[3] in the Operation entry where in=path, a test variable is defined. []
query parameters For each Parameter[3] in the Operation entry where in=query, a test query paramer is defined. []
headers For each Parameter[3] in the Operation entry where in=header, a test header is defined. If any requestBody[4] body is also imported, an additional header is defined for the corresponding Content-Type []
auth Auth is imported to your web service's environment based on the SecurityRequirement defined in the spec Uses default auth if no other options are available
request body The requestBody body for an Operation [4]. An additional header is imported for the corresponding Content-Type. []
status code assertion Imported from responses in the Operation. The lowest status code possible is used with the exception that 2XX is preferred over 1XX. 200
json schema assertion Imported from responses in the Operation. If any response defines a schema, that response is preferred. If a JSON Schema assertion is defined for a response then the status code assertion will contain the correct code. To override this behavior for successful requests, simply define a responses entry with a 200 or desired status code. []

See our blog post Sync changes from OpenAPI/Swagger specifications with Assertible API tests for more details on how this feature works.

Syncing Postman Collections

By default, when you import a Postman Collection Assertible creates a test for each unique collection item. However, Assertible still ensures unique tests by using a combination of the METHOD/ENDPOINT to reliably sync future changes.

Configure the id field on your item to override Assertible's default unique test identification to have complete control over all future updates to a specific test.

Postman Collection import fields

See the Postman Collection Schema docs for clarification on references the references in the table below.

Assertible field Postman Collection field Default
method The method defined in the Item request configuration. GET (used when the request is a plain URL)
endpoint The path portion of the request url. /
name The item name. Combination of operation and path name
description The item description or parent Collection description. null
variables All variables defined in the item are imported as test variables. []
query parameters Extracted from the request url. []
headers All item headers are imported as test headers. []
request body The item body. null
status code assertion Status code 200 is used on all tests. 200

The easiest way to test and
monitor your web services

Define and test your web service with Assertible Track and test API deployments across environments Schedule API monitoring and failure alerts

Reduce bugs in web applications by using Assertible to create an automated QA pipeline that helps you catch failures & ship code faster.

Sign up for free