PHPackages                             religisaci/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. religisaci/codeception-api-validator

ActiveLibrary[API Development](/categories/api)

religisaci/codeception-api-validator
====================================

Validate API Requests and Responses against Swagger / OpenAPI definitions. This package is modified awuttig/codeception-api-validator package for PHP 7.4

1.0.0(3y ago)1961↓50%PHP

Since Feb 28Pushed 3y agoCompare

[ Source](https://github.com/religisaci/codeception-api-validator)[ Packagist](https://packagist.org/packages/religisaci/codeception-api-validator)[ RSS](/packages/religisaci-codeception-api-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

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

[](#codeception-api-validator)

Validate API Requests and Responses against Swagger / OpenAPI definitions

*Note: this is based on awuttig/codeception-api-validator and modified for **PHP 7.4***

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

[](#installation)

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

```
    composer require --dev religisaci/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:
        - \Religisaci\ApiValidator:
            depends: [REST, PhpBrowser]
            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)
- **Tomáš Hojgr** - *Modification for PHP 7.4* - [Religisaci](https://github.com/religisaci)

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

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Unknown

Total

1

Last Release

1175d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b7c0f41f039dc3ff97740e1356367ff27bf8ef7699d4b4e1f7322dcd016bfb6?d=identicon)[religis](/maintainers/religis)

---

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)")[![religisaci](https://avatars.githubusercontent.com/u/69236143?v=4)](https://github.com/religisaci "religisaci (4 commits)")[![tomashojgr](https://avatars.githubusercontent.com/u/44899639?v=4)](https://github.com/tomashojgr "tomashojgr (2 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)")

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

67410.3M25](/packages/googleads-googleads-php-lib)[fschmtt/keycloak-rest-api-client-php

PHP client to interact with Keycloak's Admin REST API.

4684.7k2](/packages/fschmtt-keycloak-rest-api-client-php)

PHPackages © 2026

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