PHPackages                             violines/rest-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. violines/rest-bundle

ActiveSymfony-bundle

violines/rest-bundle
====================

violines/rest-bundle is a Symfony Bundle to create REST APIs. It focusses on HTTP standards and integrates the symfony/serializer and symfony/validator.

v0.8.1(4y ago)361931[2 issues](https://github.com/violines/rest-bundle/issues)MITPHPPHP ^8.0

Since Feb 7Pushed 4y ago3 watchersCompare

[ Source](https://github.com/violines/rest-bundle)[ Packagist](https://packagist.org/packages/violines/rest-bundle)[ RSS](/packages/violines-rest-bundle/feed)WikiDiscussions 0.x Synced today

READMEChangelog (10)Dependencies (20)Versions (16)Used By (0)

About
-----

[](#about)

violines/rest-bundle is a Symfony Bundle to create REST APIs. It focusses on HTTP standards and integrates the symfony/serializer and symfony/validator.

[![build](https://github.com/violines/rest-bundle/workflows/build/badge.svg)](https://github.com/violines/rest-bundle)[![Code Coverage](https://camo.githubusercontent.com/027fe6d4737f25a1666a99fe929bd53119763dd89a59d873c9f2418938ca2261/68747470733a2f2f636f6465636f762e696f2f67682f76696f6c696e65732f726573742d62756e646c652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/violines/rest-bundle/)[![Mutation testing badge](https://camo.githubusercontent.com/e439ce56994d0a2d39c751a686a70ade8cc3ef108dc2ca8b5fe1b83b52d74f7d/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d25324676696f6c696e6573253246726573742d62756e646c652532466d6173746572)](https://dashboard.stryker-mutator.io/reports/github.com/violines/rest-bundle/master)[![type coverage](https://camo.githubusercontent.com/0750850679b9e95f88daa34a59756f28882b7e2032a13600519068b4cabb6243/68747470733a2f2f73686570686572642e6465762f6769746875622f76696f6c696e65732f726573742d62756e646c652f636f7665726167652e737667)](https://shepherd.dev/github/violines/rest-bundle)[![Technical Debt](https://camo.githubusercontent.com/e29ac6484376872e7fb9e9d4a6d802f5c40bf43ad215f03b424552ad6932dca7/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d76696f6c696e65735f726573742d62756e646c65266d65747269633d7371616c655f696e646578)](https://sonarcloud.io/dashboard?id=violines_rest-bundle)[![Software License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)[![Wiki Docs](https://camo.githubusercontent.com/b082535303e1200f03e2116b3d04b56e0a5f5c1ac3a75596c776e34356c5e127/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f77696b692d646f63732d423239373030)](https://github.com/violines/rest-bundle/wiki)

### Features

[](#features)

- Request body or query string to object conversion
- Response building from objects
- Configurable content negotiation
- Events to control symfony/serializer context
- Integration of symfony/validator
- Error Handling
- Optional Logging

### Compatible with...

[](#compatible-with)

- Symfony 5.4 + 6
- PHP 8 + 8.1

### Designed for...

[](#designed-for)

modern architectures that apply Domain Driven Design principles, hexagonal architecture or similar concepts.

### Install

[](#install)

```
composer require violines/rest-bundle
```

### How does it work?

[](#how-does-it-work)

1. Create any PHP class (Entity, DTO, Command, Query, etc) and add the `#[HttpApi]` attribute or `@HttpApi` annotation
2. Use any property attributes/annotations from symfony/serializer or symfony/validator
3. Declare this PHP class as type of a controller argument
4. Return an instance of this PHP class in the controller

### Show Case

[](#show-case)

Find a sample of usage under: .

Example
-------

[](#example)

```
