PHPackages                             nijens/openapi-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. nijens/openapi-bundle

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

nijens/openapi-bundle
=====================

Helps you create a REST API from your OpenAPI specification.

2.1.1(1y ago)18108.1k↓15.2%5[1 PRs](https://github.com/nijens/openapi-bundle/pulls)MITPHPPHP ^7.4 || ^8.0

Since Oct 29Pushed 3mo ago4 watchersCompare

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

READMEChangelog (10)Dependencies (22)Versions (26)Used By (0)

OpenAPI bundle
==============

[](#openapi-bundle)

[![Latest version on Packagist](https://camo.githubusercontent.com/0c33cc75354fc8d97ce76cff1b78b4ceed12568a522b093cdc9e2af1220cfc21/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e696a656e732f6f70656e6170692d62756e646c652e737667)](https://packagist.org/packages/nijens/openapi-bundle)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![Build Status](https://github.com/nijens/openapi-bundle/actions/workflows/continuous-integration.yaml/badge.svg)](https://github.com/nijens/openapi-bundle/actions/workflows/continuous-integration.yaml)[![Code Quality](https://camo.githubusercontent.com/c79260b9c8e80574ffdb1057acf84dae0ede393d0a9b0ebbd7ee3afbf955b8dc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6e696a656e732f6f70656e6170692d62756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/nijens/openapi-bundle/?branch=master)

Helps you create a REST API from your OpenAPI specification.

This bundle supports a design-first methodology for creating an API with Symfony by providing the following tools:

- [Loading the path items and operations of an OpenAPI specification as routes](#routing)
- [Validation of the request to those routes](#validation-of-the-request)
- [Deserialization of a validated JSON request body into an object](#deserialize-a-json-request-body)
- [OpenAPI-based serialization context for the Symfony Serializer](#openapi-based-serialization-context-for-the-symfony-serializer)
- [Exception handling](#exception-handling)

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

[](#installation)

### Applications that use Symfony Flex

[](#applications-that-use-symfony-flex)

Open a command console, enter your project directory and execute:

```
composer require nijens/openapi-bundle
```

### Applications that don't use Symfony Flex

[](#applications-that-dont-use-symfony-flex)

#### 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 nijens/openapi-bundle
```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

#### Step 2: Enable the Bundle

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

Then, enable the bundle by adding it to the list of registered bundles in the `src/Kernel.php` file of your project:

```
