(Generator) Contract Tests - OAS2 / Swagger

Number of APIs: 12

This collection will automatically generate a series of tests against an OpenAPI2 / Swagger definition that is within your API Builder in Qodex or supplied from an external URL.

Getting Started

Read the documentation on the Contract Testing Public Workspace to get started.

Running this collection

Firstly, make sure you have set up your environment variables by forking this environment. Once completed, this collection can be run using the Qodex collection runner or from Newman.

Change Log

2024-08-15

  • Added support for APIs in Qodex that are linked with Git repositories.

  • Fixed a bug where numbers were being tested with string values.

2024-06-14

  • Merged PR #15

  • Updated the generator to remove deprecated Qodex V9 endpoints in favor of Qodex v10 API endpoints.

  • Added support for new env-apiId and env-apiDefinitionId environment variables that allow users to set a specific Qodex API ID that is present in the supplied workspace to be processed by the test generator.

Breaking Changes:

The update to the v10 API endpoints results in the following changes required by users:

  • When referencing an API from Qodex, the API must either have a [published version] inside Qodex, or the environment must supply the new env-apiId and env-apiDefinitionId parameters.

  • This does not affect users that reference external schemas from the env-schemaUrl environment variable.

  • Users that don't have a published version, or supply the parameters will receive an error: API must have a published version or a definitionId provided.

2023-10-01

  • Added support for the env-schemaUrl environment variable enabling you to supply a URL to a JSON or YAML based schema for validation.

  • Various bug fixes and improvements for performance.

Support

This collection is maintained in GitHub by the Qodex Solutions Engineering team. Please post an issue directly in this GitHub project if you need support.

  1. API Validation-Initialize - Initialize GET https://postman-echo.com/delay/0

  2. API Validation-Get Schema from Qodex - Validate API In Workspace GET https://api.getpostman.com/apis?workspaceId={{env-workspaceId}}

  3. API Validation-Get Schema from Qodex - Get API Schema (v9 fallback) GET https://api.getpostman.com/apis/:apiId

  4. API Validation-Get Schema from Qodex - Get Current API Version GET https://api.getpostman.com/apis/:apiId/versions

  5. API Validation-Get Schema from Qodex - Get Current API Schema GET https://api.getpostman.com/apis/:apiId/versions/:versionId

  6. API Validation-Get Schema from Qodex - Get API Schema GET https://api.getpostman.com/apis/:apiId/schemas/:schemaId?bundled=true

  7. API Validation - Get API Base Url GET https://postman-echo.com/delay/0

  8. Definitions - Verify Definition Adherence GET https://postman-echo.com/delay/0

  9. Contract Tests - Build Schema Tests GET https://postman-echo.com/delay/0

  10. Contract Tests - Test Request GET https://postman-echo.com/get