PHPackages                             awuttig/codeception-api-validator - 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. [API Development](/categories/api)
4. /
5. awuttig/codeception-api-validator

ActiveLibrary[API Development](/categories/api)

awuttig/codeception-api-validator
=================================

Validate API Requests and Responses against Swagger / OpenAPI definitions

2.0.1(3y ago)188355[2 issues](https://github.com/aWuttig/codeception-api-validator/issues)PHPCI failing

Since May 25Pushed 3y ago2 watchersCompare

[ Source](https://github.com/aWuttig/codeception-api-validator)[ Packagist](https://packagist.org/packages/awuttig/codeception-api-validator)[ RSS](/packages/awuttig-codeception-api-validator/feed)WikiDiscussions master Synced 4d ago

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

codeception-api-validator
=========================

[](#codeception-api-validator)

Validate API Requests and Responses against Swagger / OpenAPI definitions

Installation
------------

[](#installation)

You need to add the repository into your composer.json file

```
    composer require --dev awuttig/codeception-api-validator
```

Usage
-----

[](#usage)

You can use this module as any other Codeception module, by adding 'ApiValidator' to the enabled modules in your Codeception suite configurations.

### Enable module and setup the configuration variables

[](#enable-module-and-setup-the-configuration-variables)

- The `schema` could be set in config file directly and via `$I->haveOpenApiSchema` or `$I->haveSwaggerSchema`

```
modules:
    enabled:
        - ApiValidator:
            depends: REST
            schema: '/tests/_data/swagger.yaml'

```

Update Codeception build

```
  codecept build
```

### Implement the cept / cest

[](#implement-the-cept--cest)

```
  $I->wantToTest('Validate request and response against OpenAPI Specification.');

  $I->sendGET('api/foo/bar');

  $I->seeRequestIsValid();
  $I->seeResponseIsValid();
```

### Methods

[](#methods)

#### seeRequestIsValid()

[](#seerequestisvalid)

Validates the current request against the current schema definiton.

```
  $I->seeRequestIsValid();

```

#### seeResponseIsValid()

[](#seeresponseisvalid)

Validates the current response against the current schema definiton.

```
  $I->seeRequestIsValid();

```

#### seeRequestAndResponseAreValid()

[](#seerequestandresponsearevalid)

Validates the current request and response against the current schema definiton.

```
  $I->seeRequestAndResponseAreValid();

```

#### haveOpenAPISchema()

[](#haveopenapischema)

Set the path to the OpenAPI Schema Specification

```
  $schema = 'file://' . codecept_root_dir('../../web/api/documentation/swagger.yaml');
  $I->haveOpenAPISchema($schema);

```

#### haveSwaggerSchema()

[](#haveswaggerschema)

Set the path to the Swagger Schema Specification

```
  $schema = 'file://' . codecept_root_dir('../../web/api/documentation/swagger.yaml');
  $I->haveSwaggerSchema($schema);

```

Authors
-------

[](#authors)

[![](https://avatars0.githubusercontent.com/u/726519?s=40&v=4)](https://avatars0.githubusercontent.com/u/726519?s=40&v=4)

- **André Wuttig** - *Concept, Initial work* - [aWuttig](https://github.com/aWuttig)

See also the list of [contributors](https://github.com/portrino/codeception-api-validator/graphs/contributors) who participated in this project.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 52.6% 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 ~221 days

Total

5

Last Release

1345d ago

Major Versions

1.x-dev → 2.0.02022-10-26

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/726519?v=4)[André](/maintainers/aWuttig)[@aWuttig](https://github.com/aWuttig)

---

Top Contributors

[![scanacs-mrableski](https://avatars.githubusercontent.com/u/87184905?v=4)](https://github.com/scanacs-mrableski "scanacs-mrableski (10 commits)")[![scanacs-agruhn](https://avatars.githubusercontent.com/u/53820628?v=4)](https://github.com/scanacs-agruhn "scanacs-agruhn (7 commits)")[![aWuttig](https://avatars.githubusercontent.com/u/726519?v=4)](https://github.com/aWuttig "aWuttig (1 commits)")[![visionpixel](https://avatars.githubusercontent.com/u/1027142?v=4)](https://github.com/visionpixel "visionpixel (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/awuttig-codeception-api-validator/health.svg)

```
[![Health](https://phpackages.com/badges/awuttig-codeception-api-validator/health.svg)](https://phpackages.com/packages/awuttig-codeception-api-validator)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M729](/packages/sylius-sylius)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M333](/packages/api-platform-core)[api-platform/symfony

Symfony API Platform integration

384.5M125](/packages/api-platform-symfony)[api-platform/state

API Platform state interfaces

274.9M132](/packages/api-platform-state)[api-platform/serializer

API Platform core Serializer

274.8M84](/packages/api-platform-serializer)[api-platform/validator

API Platform validator component

274.6M27](/packages/api-platform-validator)

PHPackages © 2026

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