Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Introduction
Allows to validate a controller response from your API project against a given [OpenAPI](https://www.openapis.org/)
specification.
Verifies API responses against an [OpenAPI](https://www.openapis.org/) specification. A response body that does not
match its documented schema is reported as a mismatch, so the specification and the API cannot drift apart unnoticed.

Supported ways to hook in:
* **Laravel and Slim tests**: a trait for the framework's test case. Every response a test receives is verified.
* **PSR-15 middleware**: verifies the responses of any PSR-15 stack, such as Slim or Mezzio.
* **Guzzle and PSR-18 clients**: verifies responses on the client side, against a running server or a mock.
* **The verifier on its own**: `OpenApiVerifier` needs only a request and its response.

## Requirements
* [PHP 8.2 or higher](http://www.php.net/)
Expand All @@ -24,7 +30,7 @@ Once composer is installed, execute the following command in your project root t
```sh
composer require radebatz/openapi-verifier
```
After that all required classes should be availabe in your project to add routing support.
After that all required classes should be available in your project.

## Usage
### The verifier
Expand Down
15 changes: 14 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
{
"name": "radebatz/openapi-verifier",
"description": "Verify JSON (api response) against OpenAPI specification.",
"description": "Verifies API responses against an OpenAPI specification, in Laravel and Slim tests, as PSR-15 middleware or in a Guzzle or PSR-18 client.",
"keywords": [
"openapi",
"swagger",
"api",
"testing",
"phpunit",
"validation",
"psr-15",
"psr-18",
"guzzle",
"laravel",
"slim"
],
"license": [
"MIT"
],
Expand Down
Loading