PHPackages                             marfatech/swagger-resolver-bundle - 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. marfatech/swagger-resolver-bundle

AbandonedArchivedSymfony-bundle[API Development](/categories/api)

marfatech/swagger-resolver-bundle
=================================

Provides possibility for validate data according to Swagger documentation

v1.0.1(3y ago)05.6k↓20%[1 PRs](https://github.com/marfatech/swagger-resolver-bundle/pulls)MITPHPPHP ~8.0

Since Aug 27Pushed 3y agoCompare

[ Source](https://github.com/marfatech/swagger-resolver-bundle)[ Packagist](https://packagist.org/packages/marfatech/swagger-resolver-bundle)[ RSS](/packages/marfatech-swagger-resolver-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (15)Versions (34)Used By (0)

Swagger Resolver Bundle [![На Русском](https://camo.githubusercontent.com/feb4c9ee227a5ee3a5d4e83a8a5b888b2e4b666d6cc2fb985c3bf404f8f271ac/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2544302539462544302542352544312538302544302542352544302542392544312538322544302542385f2544302542442544302542302d2544302541302544312538332544312538312544312538312544302542412544302542382544302542392d677265656e2e7376673f7374796c653d666c61742d737175617265)](./README.RU.md)
===================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#swagger-resolver-bundle-)

[![Latest Stable Version](https://camo.githubusercontent.com/a99d493a0c439d4a5f5edda0a5e90d75b36dbea43353c74cefd738cfa86c9704/68747470733a2f2f706f7365722e707567782e6f72672f6d61726661746563682f737761676765722d7265736f6c7665722d62756e646c652f762f737461626c65)](https://packagist.org/packages/marfatech/swagger-resolver-bundle)[![Total Downloads](https://camo.githubusercontent.com/de8d12f2094620c9756591037eb340b7556ced4e098a5267a8be55d6dd32c167/68747470733a2f2f706f7365722e707567782e6f72672f6d61726661746563682f737761676765722d7265736f6c7665722d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/marfatech/swagger-resolver-bundle)

[![knpbundles.com](https://camo.githubusercontent.com/babc2c75a92a063f6ffcedbdba4f12f43b1e0ba6d78696462eb4a6e193fee005/687474703a2f2f6b6e7062756e646c65732e636f6d2f6d61726661746563682f737761676765722d7265736f6c7665722d62756e646c652f62616467652d73686f7274)](http://knpbundles.com/marfatech/swagger-resolver-bundle)

Introduction
------------

[](#introduction)

Bundle provides possibility for validate data according to the OpenApi 3 documentation. You describe your API documentation by OpenApi and provides verification of data for compliance with the described requirements. When documentation has been updated then verification will be updated too, all in one place!

**Documentation is cached** through the standard [Symfony Cache](https://symfony.com/doc/current/components/cache.html) mechanism.

*Note:* as result bundle returns [OptionsResolver](https://github.com/symfony/options-resolver) object. The object contains the created set of data requirements.

*Attention:* remember, when you change generated `SwaggerResolver` object you risk to get divergence with actual documentation.

### Integrations

[](#integrations)

Bundle provides integration with [NelmioApiDocBundle](https://github.com/nelmio/NelmioApiDocBundle), supports configuration loading by [swagger-php](https://github.com/zircote/swagger-php) and also supports loading directly from the `json` or `yaml`(`yml`) configuration file. When used default bundle configuration then swagger documentation will be load in most optimal available way. Loaders priority:

1. `NelmioApiDocBundle` - do not require any additional configuration.
2. `swagger-php` - Uses `openapi_annotation.[area].scan` and `openapi_annotation.[area].exclude` parameters.
3. `json` - Uses `configuration_file.[area].file` parameter.

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

[](#installation)

### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
    composer require marfatech/swagger-resolver-bundle
```

*is command requires you to have [Composer](https://getcomposer.org) install globally.*

### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by updating your `app/AppKernel.php` file to enable the bundle:

```
