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.2(2mo ago)51.7k3[10 issues](https://github.com/citizen63000/easy-api-bundle/issues)1MITPHPPHP ^8.3CI passing

Since Jul 28Pushed 2mo 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 2w ago

READMEChangelog (10)Dependencies (110)Versions (131)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

52

—

FairBetter than 96% of packages

Maintenance67

Regular maintenance activity

Popularity22

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity88

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 ~19 days

Recently: every ~160 days

Total

115

Last Release

64d 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://avatars.githubusercontent.com/u/66557423?v=4)[citizen63000](/maintainers/citizen63000)[@citizen63000](https://github.com/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

[kimai/kimai

Kimai - Time Tracking

4.8k9.4k1](/packages/kimai-kimai)[sylius/sylius

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

8.5k6.0M777](/packages/sylius-sylius)[chameleon-system/chameleon-base

The Chameleon System core.

1029.4k6](/packages/chameleon-system-chameleon-base)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1617.3k16](/packages/2lenet-crudit-bundle)[sulu/sulu

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

1.3k1.4M236](/packages/sulu-sulu)[oro/platform

Business Application Platform (BAP)

645146.3k118](/packages/oro-platform)

PHPackages © 2026

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