PHPackages                             dmp/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. [API Development](/categories/api)
4. /
5. dmp/rest-bundle

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

dmp/rest-bundle
===============

DMP Rest bundle

2.1.0(2mo ago)0619MITPHPPHP ^8.4

Since Oct 14Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/Armenian/rest-bundle)[ Packagist](https://packagist.org/packages/dmp/rest-bundle)[ RSS](/packages/dmp-rest-bundle/feed)WikiDiscussions main Synced today

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

REST Bundle
===========

[](#rest-bundle)

This bundle provides convenient functionality to write simple and powerful JSON-based RPC controllers

How to use:
-----------

[](#how-to-use)

Add bundle `DMP\RestBundle\RestBundle` to your kernel.

Write controllers in a style:

```
use DMP\RestBundle\Annotation as Rest;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
use Symfony\Component\Routing\Attribute\Route;

class TestController
{

    #[Route("/api/test", methods: ["POST"])]
    #[Rest\Serializable(statusCode: 201)]
    public function request(#[MapRequestPayload] RequestDTO $request): ResponseDTO
    {
        ...
    }
}
```

where RequestDTO and ResponseDTO are Data Transfer Objects that should define Serialization and Validation rules for the fields

All routes should start with '/api/' (TODO: remove this hard-coded requirement)

Consult `tests/Fixtures/` directory for an overview of how to define Rest Controllers

Request Data Mapping
--------------------

[](#request-data-mapping)

Use Symfony's native attributes for mapping request data to DTOs:

- `#[MapRequestPayload]` for JSON request body.
- `#[MapQueryString]` for query parameters.

The bundle's `ExceptionListener` will automatically catch validation errors from these attributes and format them into a consistent JSON response.

Exceptions
----------

[](#exceptions)

If the controller throws an exception, it will be converted into a response in the form

```
{
  "errors": [
    {
      "message": "Exception message"
    }
  ]
}
```

Validation error responses are different:

```
{
  "errors": [
    {
      "message": "Field value should be a valid email address.",
      "field": "email",
      "parameters": {}
    },
    {
      "message": "Field value should not be blank.",
      "field": "password"
    }
  ]
}
```

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance83

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 82.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~67 days

Recently: every ~148 days

Total

20

Last Release

87d ago

Major Versions

0.10.2 → 1.0.02024-08-21

0.10.3 → 2.0.02026-04-07

PHP version history (2 changes)0.1.0PHP &gt;=8.1

2.0.0PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6642299?v=4)[David Akopyan](/maintainers/Armenian)[@Armenian](https://github.com/Armenian)

---

Top Contributors

[![Armenian](https://avatars.githubusercontent.com/u/6642299?v=4)](https://github.com/Armenian "Armenian (24 commits)")[![rauls-kjarners](https://avatars.githubusercontent.com/u/5276288?v=4)](https://github.com/rauls-kjarners "rauls-kjarners (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dmp-rest-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/dmp-rest-bundle/health.svg)](https://phpackages.com/packages/dmp-rest-bundle)
```

###  Alternatives

[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

515100.5k3](/packages/web-auth-webauthn-framework)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M735](/packages/sylius-sylius)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M338](/packages/api-platform-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
