Download the PHP package studio-design/openapi-contract-testing without Composer

On this page you can find all versions of the php package studio-design/openapi-contract-testing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package openapi-contract-testing

Gesso logo

Gesso

/ˈdʒɛs.so/ — pronounced “JESS-so”

Gesso is the primer applied to a canvas before painting—a stable, receptive ground on which the finished work can be built. Gesso brings that same idea to APIs, providing a dependable foundation for OpenAPI contract testing in PHP.

CI Latest Version Total Downloads PHP Version Require License

Gesso provides framework-agnostic OpenAPI 3.0/3.1/3.2 contract testing for PHPUnit with endpoint coverage tracking.

Validate your API responses against your OpenAPI specification during testing, and get a coverage report showing which endpoints have been tested.

Gesso 2 is distributed as studio-design/gesso and declares its public PHP API under Studio\Gesso\. Follow the staged v2 migration guide when upgrading from studio-design/openapi-contract-testing v1.10.

Search the documentation · Core quickstart · Laravel · Symfony · Pest

Features

Conformance evidence: every example document the OpenAPI Initiative publishes for 3.0, 3.1, and 3.2 loads without error — 11 documents in both their JSON and YAML forms, of which ten are issue-free and tictactoe reports three security schemes as recognized but not enforced. The schema rewriting behind the claims above is pinned against the official JSON Schema Test Suite: of 3,784 cases compared, conversion changes the verdict on 11, all of them deliberate and individually documented. Both corpora are pinned by commit SHA and enforced in CI. See docs/conformance.md.

Why this library?

Choose based on the workflow you need rather than on a single yes/no feature count:

Feature comparison (checked 2026-07-10)

Capability This library Spectator v3.0.2 league/psr7 v0.24 osteel v0.14 kirschbaum v2.0.2
OpenAPI versions explicitly supported 3.0, 3.1, 3.2 Version scope not stated 3.0.x 3+; delegates to League v0.22 Delegates to League v0.14–0.24
Request + response validation ✅ Laravel ✅ PSR-7 ✅ HttpFoundation / PSR-7 ✅ Laravel HTTP tests
Coverage granularity method, path, status, content-type method, path operation
Coverage outputs Markdown, JUnit XML, JSON, HTML, GitHub Step Summary Text, JSON
Parallel coverage merge Sidecar + merge CLI Not documented
Route/spec parity gesso:routes with text/JSON and CI gates spectator:routes
CLI diagnostics / scaffolding stubs scoped to uncovered responses validate, coverage, routes, stubs
Structured validation failures issues() + versioned JSON failure output JSON {errors: [...]} PHP exception hierarchy Wrapper exception PHPUnit failure text
Schema-driven exploration Deterministic endpoint + whole-spec generation
Drift / under-description checks strict required
First-class integration Laravel, Symfony, Pest Laravel PSR-7, PSR-15 middleware HttpFoundation, PSR-7 Laravel auto-validation
Declared runtime floor PHP 8.3 core; Laravel 13 / PHP 8.3) PHP 8.3, Laravel 12 PHP 7.2 PHP 8.0, HttpFoundation 5–8 PHP 8.0, Illuminate 10–13

Legend: ✅ supported · — no equivalent feature documented. “Not documented” is intentionally different from “unsupported”.

Methodology: This is a documentation/source audit, not a benchmark. Claims are limited to the linked, tag-pinned public documentation and Composer constraints checked on 2026-07-10. This-library claims describe main at 8c6416d; competitor versions are shown in the table header. Re-check this matrix using the release checklist at least quarterly or before a release when three months have elapsed.

Requirements

Installation

YAML specs require symfony/yaml. It is listed under suggest so it isn't installed automatically. If your spec is JSON, you can skip this. If your spec is .yaml / .yml, add it explicitly:

Without it, the loader throws InvalidOpenApiSpecException with a clear "requires symfony/yaml" message the first time it tries to read a YAML file.

Quick start

Choose the CI-tested five-minute path matching your stack:

Stack Passing example What it demonstrates
Framework-independent PHPUnit examples/core Direct response validation and coverage
Laravel examples/laravel Explicit assertion, auto_assert, and request validation
Symfony examples/symfony HttpFoundation request/response assertions
Pest examples/pest Laravel response and request expectations
PSR-7 examples/psr7 Request/response exchange validation

All paths start with the same development dependency:

The example below uses a PSR-7 request and response. The searchable documentation contains the complete core, Laravel, Symfony, and Pest quickstarts.

1. Provide your OpenAPI spec

Point the loader at your spec's entry file. Internal and local-filesystem $ref are resolved automatically — no pre-bundling required:

2. Register the PHPUnit extension

Before running your first test, verify that the package can load and enforce the contract:

The command resolves local references, checks the OpenAPI/JSON Schema dialect, reports unsupported enforcement features, counts discovered operations and responses, and exits non-zero for incompatible specs. Use --format=json in CI. See the doctor command reference for multiple specs, HTTP references, output categories, and exit codes.

Then register the emitted configuration:

3. Validate a PSR-7 exchange

When your application or HTTP client already returns PSR-7 messages, validate both sides and record coverage with one framework-independent call:

The adapter accepts any psr/http-message implementation; no concrete PSR-7 package is added to production dependencies. A PHPUnit assertion trait, response-only operation addressing, PSR-15 test recipe, and stream guarantees are covered in the PSR-7 guide.

Laravel adapter

Set default_spec in the published config/gesso.php, then mix in the trait:

Before running tests, compare Laravel's registered routes with the spec:

To validate every response automatically, set 'auto_assert' => true and drop the explicit assert call. To also catch request-side drift, set 'auto_validate_request' => true. See docs/setup.md for the full configuration and opt-out reference.

Documentation

Topic Reference
PSR-7 request / response / exchange validation and PSR-15 test recipe docs/psr7.md
Full setup, Laravel / Symfony / framework-agnostic adapters, auto-assert, opt-out attributes, request validation, HTTP $ref docs/setup.md
Pre-test compatibility diagnostics (gesso doctor) docs/doctor.md
Laravel route/spec parity (gesso:routes) docs/laravel-route-parity.md
Pest plugin: expect()->toMatchOpenApiResponseSchema() and friends docs/pest-plugin.md
Schema-driven request fuzzing & named contract checks docs/fuzzing.md
Enum drift detection docs/enum-drift.md
Schema under-description detection (strict_required) docs/strict-required.md
Undocumented response-property detection (strict_additional_properties) docs/strict-additional-properties.md
Violation baseline: adopt on a legacy API, fail only on new violations docs/baseline.md
Coverage baseline: gate the set of uncovered responses instead of a percentage docs/coverage-baseline.md
Coverage report modes & threshold gate docs/coverage.md
Spec patch coverage: fail a PR that changes an operation no test covers docs/coverage-gate.md
Test stub scaffolding for the responses no test covers docs/stubs.md
HTML coverage output docs/coverage-html-output.md
JSON coverage output schema docs/coverage-json-schema.md
JSON validation result output schema docs/validation-json-schema.md
Parallel test runners (paratest / Pest --parallel) docs/parallel.md
CI integration (GitHub Actions, PR comments, output formats, partial-run handling) docs/ci.md
API reference (OpenApiResponseValidator, OpenApiSpecLoader, OpenApiCoverageTracker) docs/api-reference.md
Supported features, known limitations, warning channel docs/supported-features.md
Conformance results (official OAS example documents, JSON Schema conversion delta) docs/conformance.md
Versioning policy & support matrix docs/versioning.md

Development

License

MIT License. See LICENSE for details.


All versions of openapi-contract-testing with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
opis/json-schema Version ^2.6
phpunit/phpunit Version ^12.0 || ^13.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.0 || ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package studio-design/openapi-contract-testing contains the following files

Loading the files please wait ...