PHPackages                             citizen63000/easy-api-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. [HTTP &amp; Networking](/categories/http)
4. /
5. citizen63000/easy-api-bundle

ActiveSymfony-bundle[HTTP &amp; Networking](/categories/http)

citizen63000/easy-api-bundle
============================

Complete API bundle to create easily your API

4.1(1y ago)51.7k3[10 issues](https://github.com/citizen63000/easy-api-bundle/issues)1MITPHPPHP ^8.3CI passing

Since Jul 28Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/citizen63000/easy-api-bundle)[ Packagist](https://packagist.org/packages/citizen63000/easy-api-bundle)[ RSS](/packages/citizen63000-easy-api-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (36)Versions (129)Used By (1)

easy-api-bundle
===============

[](#easy-api-bundle)

Symfony bundle to easily make api, inspired by work of [DarwinOnLine](https://github.com/DarwinOnLine)

### CRUD controllers :

[](#crud-controllers-)

Exemple :

```
/**
 * @Route("/my-path", name="my_path")
 * @OA\Tag(name="MyEntity")
 */
class MyEntityCrudController extends AbstractApiController
{
    public const entityClass = MyEntity::class;
    public const entityCreateTypeClass = MyEntityType::class;
    public const entityUpdateTypeClass = MyEntityType::class;
    public const serializationGroups = ['my_entity_full'];
    public const listSerializationGroups = ['my_entity_light'];
    public const filterFields = [];
    public const filterSortFields = [];

    use CrudControllerTrait;
}
```

### CRUD routing :

[](#crud-routing-)

Example:

```
api_my_path:
  resource: "@AppBundle/Controller/MyContext/MyController.php"
  type: annotation
```

### Configuration (everything is optionnal) :

[](#configuration-everything-is-optionnal-)

```
easy_api:
  authentication: true
  user_class: AppBundle\Entity\User\User
  user_tracking :
    enable: false
    connection_history_class: AppBundle\Entity\User\ConnectionHistory
  inheritance:
    entity: 'App\Entity\AbstractEntity'
    entityReferential: 'App\Entity\AbstractReferential'
    form: 'App\Form\Type\AbstractCoreType'
    repository: 'App\Form\Type\AbstractRepository'
    controller: 'App\Controller\AbstractApiController'
    serialized_form: 'App\Form\Model\SerializedForm'
  tests:
    debug: true # true by default
    datetime_format: 'Y-m-d H:i:s' # DateTimeInterface::ATOM format by default
```

### Form options for frontend apps :

[](#form-options-for-frontend-apps-)

You can specify some options in attr field of form fields:

- group : to group fields
- discriminator
- other options you want to pass

### API-DOC Annotations

[](#api-doc-annotations)

You can use all annotations of the nelmio api bundle. The DoctrineAnnorationReader cannot read self and static constants but with this bundle you can use it as strings in two cases as long as the issue isn't closed :

In Nelmio model annotation:

```
    /**
     * Get entity.
     *
     * @OA\Annotations\Response(
     *     response=200,
     *     description="Successful operation",
     *     @OA\Annotations\Schema(
     *          ref=@Nelmio\ApiDocBundle\Annotation\Model(
     *              type="static::entityClass",
     *              groups={"static::serializationGroups"}
     *          )
     *      )
     * ),
     * @param Request $request
     *
     * @return Response
     */
    public function getAction(Request $request)
    {
        ...
    }
```

And in an annotation named "GetFormParameter" which allows you to generate api-doc of form fields as get parameters :

```
     /**
      * List entities.
      *
      * @EasyApiBundle\Annotation\GetFormParameter(type="static::entitySearchTypeClass")
      * ...
      */
    public function listAction(Request $request)
    {
        ...
    }
```

Test framework
--------------

[](#test-framework)

### User assertion:

[](#user-assertion)

Define it in `php static::$additionalAssessableFunctions ` and implement it, with good parameters :

```
static::$additionalAssessableFunctions = ['assertMyAssertion'];
...
/**
* @param $key The key in response
* @param $parameter The parameter passed (optionnal)
* @param $value The value in response
*/
protected static function assertMyAssertion($key, $parameter, $value): void
{
    $parameter = $parameter ?? 'John';
    $expected = "hello world $parameter";
    $errorMessage = "Invalid value for {$key} field: expected {$expected}, get {$value}";
    static::assertTrue($expected === $value, $errorMessage);
}
```

Performance optimization
------------------------

[](#performance-optimization)

- Implement the Symfony\\Component\\Serializer\\Normalizer\\CacheableSupportsMethodInterface on normalizers (see [https://symfony.com/doc/current/serializer/custom\_normalizer.html](https://symfony.com/doc/current/serializer/custom_normalizer.html))
- see

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 88.1% 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 ~14 days

Recently: every ~53 days

Total

113

Last Release

508d ago

Major Versions

0.90 → 1.02023-02-21

1.x-dev → 2.02023-08-24

2.0.1 → 3.02023-10-18

3.2.9 → 4.02024-09-12

PHP version history (4 changes)0.10PHP ^7.2

0.90PHP &gt;=7.4.3

3.0PHP ^8.1

4.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ac0b849e9ea8ba62341be3fd5b3099b4027fea6fed69dcaf8c792166a9e3eff?d=identicon)[citizen63000](/maintainers/citizen63000)

---

Top Contributors

[![nextgenconcept](https://avatars.githubusercontent.com/u/57262330?v=4)](https://github.com/nextgenconcept "nextgenconcept (391 commits)")[![citizen63000](https://avatars.githubusercontent.com/u/66557423?v=4)](https://github.com/citizen63000 "citizen63000 (52 commits)")[![ivolc](https://avatars.githubusercontent.com/u/195326137?v=4)](https://github.com/ivolc "ivolc (1 commits)")

---

Tags

apirest

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/citizen63000-easy-api-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/citizen63000-easy-api-bundle/health.svg)](https://phpackages.com/packages/citizen63000-easy-api-bundle)
```

###  Alternatives

[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)

PHPackages © 2026

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