PHPackages                             mathrix/openapi-assertions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. mathrix/openapi-assertions

Abandoned → [mathrix-education/openapi-assertions](/?search=mathrix-education%2Fopenapi-assertions)Library[Testing &amp; Quality](/categories/testing)

mathrix/openapi-assertions
==========================

Validate PSR-7 requests against OpenAPI specification. Heavily based on league/openapi-psr7-validator.

1.0.0(6y ago)0652MITPHPPHP &gt;=7.1

Since May 29Pushed 6y ago1 watchersCompare

[ Source](https://github.com/mathrix-education/openapi-assertions)[ Packagist](https://packagist.org/packages/mathrix/openapi-assertions)[ Docs](https://github.com/mathrix-education/openapi-assertions)[ RSS](/packages/mathrix-openapi-assertions/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (6)Versions (10)Used By (0)

mathrix-education/openapi-assertions
====================================

[](#mathrix-educationopenapi-assertions)

[![version](https://camo.githubusercontent.com/19404eef6e3493d2841032e105191ef8b6d272fb23de66f5b2da68fc872841d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6174687269782d656475636174696f6e2f6f70656e6170692d617373657274696f6e733f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/19404eef6e3493d2841032e105191ef8b6d272fb23de66f5b2da68fc872841d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6174687269782d656475636174696f6e2f6f70656e6170692d617373657274696f6e733f7374796c653d666c61742d737175617265)[![license](https://camo.githubusercontent.com/6938dbd18281805ae3cfc005254271f00847bf43754abbdec1923183edffef29/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6174687269782d656475636174696f6e2f6f70656e6170692d617373657274696f6e733f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/6938dbd18281805ae3cfc005254271f00847bf43754abbdec1923183edffef29/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6174687269782d656475636174696f6e2f6f70656e6170692d617373657274696f6e733f7374796c653d666c61742d737175617265)[![php-version](https://camo.githubusercontent.com/ed4db45e475caeca68427b1c6c05c8664f6f6ce58d19c43a4fb95c42f2462ba1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d6174687269782d656475636174696f6e2f6f70656e6170692d617373657274696f6e733f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/ed4db45e475caeca68427b1c6c05c8664f6f6ce58d19c43a4fb95c42f2462ba1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d6174687269782d656475636174696f6e2f6f70656e6170692d617373657274696f6e733f7374796c653d666c61742d737175617265)

Base library of all Mathrix Education SA PHP projects.

Allow to test API responses against an OpenAPI v3 specification. Proudly maintained by Mathieu Bour , Vice-CTO.

The library heavily relies on [league/openapi-psr7-validator](https://github.com/thephpleague/openapi-psr7-validator)formerly [lezhnev74/openapi-psr7-validator](https://github.com/lezhnev74/openapi-psr7-validator).

Lumen
-----

[](#lumen)

In order to use OpenAPI assertions with lumen, you need to install symfony/psr-http-message-bridge and nyholm/psr7. You can do it with:

```
composer require --dev nyholm/psr7 symfony/psr-http-message-bridge
```

Then, add the LumenOpenAPIAssertions trait to your base TestCase, like so:

```
use \Mathrix\OpenAPI\Assertions\Lumen\LumenOpenAPIAssertions;

class TestCase extends LumenTestCase {
    use LumenOpenAPIAssertions;

    public static function setupBeforeClass()
    {
        self::$openAPISpecificationPath = PATH_TO_SPEC_YAML;
        self::bootLumenOpenAPIAssertions();
    }
}
```

### Usage

[](#usage)

To test that an Illuminate Response matches the specification, simply run:

```
class TestBar extends TesCase {
    public function testFoo() {
        // Your test code
        $this->assertOpenAPIResponse($response); // Where response extends \Illuminate\Http\Response
    }
}
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~24 days

Total

9

Last Release

2344d ago

Major Versions

0.11.0 → 1.0.02019-12-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/73c2dfce49dda5261f96316534da32fe654b5318a85049d85b651bdda2aeb167?d=identicon)[Mathieu Bour](/maintainers/Mathieu%20Bour)

---

Top Contributors

[![matbour](https://avatars.githubusercontent.com/u/21281702?v=4)](https://github.com/matbour "matbour (11 commits)")

---

Tags

phpunitopenapilumenassertions

### Embed Badge

![Health badge](/badges/mathrix-openapi-assertions/health.svg)

```
[![Health](https://phpackages.com/badges/mathrix-openapi-assertions/health.svg)](https://phpackages.com/packages/mathrix-openapi-assertions)
```

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[nette/tester

Nette Tester: enjoyable unit testing in PHP with code coverage reporter. 🍏🍏🍎🍏

4917.3M1.5k](/packages/nette-tester)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[robiningelbrecht/phpunit-pretty-print

Prettify PHPUnit output

76460.0k15](/packages/robiningelbrecht-phpunit-pretty-print)[phpunit/phpunit-dom-assertions

DOM assertions for PHPUnit

29343.5k11](/packages/phpunit-phpunit-dom-assertions)[rybakit/phpunit-extras

Custom annotations and expectations for PHPUnit.

4778.2k1](/packages/rybakit-phpunit-extras)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
