(Generator) Contract Tests - OAS3
Number of APIs: 12
This collection will automatically generate a series of tests against an OpenAPI3 definition that is within your API Builder in Qodex.
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, Qodex CLI, 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
andenv-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
andenv-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-08-08
Added support for retrieving schema from a URL from CLI.
You can now supply the env-schemaUrl
property either via the environment or via the CLI. This will cause the collection to retrieve the API specification from the supplied URL instead of attempting to fetch it from the Qodex workspace.
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.
-
API Validation-Initialize - Initialize GET https://postman-echo.com/delay/0
-
API Validation-Get Schema from Qodex - Validate API In Workspace GET https://api.getpostman.com/apis?workspaceId={{env-workspaceId}}
-
API Validation-Get Schema from Qodex - Get Current API Schema GET https://api.getpostman.com/apis/:apiId/versions/:versionId
-
Contract Tests - Test Request GET https://postman-echo.com/get
-
API Validation-Get Schema from Qodex - Get API Schema GET https://api.getpostman.com/apis/:apiId/schemas/:schemaId?bundled=true
-
API Validation-Get Schema from Qodex - Get API Schema (v9 fallback) GET https://api.getpostman.com/apis/:apiId
-
API Validation - Get API Base Url GET https://postman-echo.com/delay/0
-
Components - Verify Component Adherence GET https://postman-echo.com/delay/0
-
Contract Tests - Build Schema Tests GET https://postman-echo.com/delay/0
-
Finalize - Remove Test Variables GET https://postman-echo.com/delay/0