PHPackages                             gpht/openapi-symfony-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. gpht/openapi-symfony-validator

ActiveLibrary[API Development](/categories/api)

gpht/openapi-symfony-validator
==============================

OpenAPI validation library for Symfony applications with PHPUnit integration

1.0.2(8mo ago)0504↓33.3%MITPHPPHP ^8.4CI passing

Since Sep 16Pushed 8mo agoCompare

[ Source](https://github.com/fotografde/openapi-symfony-validator)[ Packagist](https://packagist.org/packages/gpht/openapi-symfony-validator)[ RSS](/packages/gpht-openapi-symfony-validator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (9)Versions (5)Used By (0)

OpenAPI Symfony Validator
=========================

[](#openapi-symfony-validator)

A PHP library for validating Symfony application requests and responses against OpenAPI specifications. This library provides PHPUnit integration through traits and automatic test case generation.

Features
--------

[](#features)

- 🚀 **Easy PHPUnit Integration**: Use the `OpenApiValidationTrait` in your test classes
- 🔄 **Automatic Test Generation**: Generate test cases from OpenAPI specifications
- 🎯 **Request/Response Validation**: Validate both HTTP requests and responses
- 🗺️ **Path Mapping**: Map OpenAPI paths to your actual application routes
- 🧪 **Symfony Integration**: Works seamlessly with Symfony's test client

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

[](#installation)

Install via Composer:

```
composer require --dev gpht/openapi-symfony-validator
```

Requirements
------------

[](#requirements)

- PHP ^8.4
- Symfony ^6.0|^7.0
- PHPUnit ^10.0|^11.0

Usage
-----

[](#usage)

### Basic Usage with Trait

[](#basic-usage-with-trait)

The easiest way to use this library is with the `OpenApiValidationTrait`:

```
