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

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

stfalcon-studio/api-bundle
==========================

Base classes and helper services to build API application via Symfony.

3.5.1(1y ago)1032.1k↓29.8%7[1 PRs](https://github.com/stfalcon-studio/ApiBundle/pulls)MITPHPPHP &gt;=8.2

Since May 22Pushed 1y ago2 watchersCompare

[ Source](https://github.com/stfalcon-studio/ApiBundle)[ Packagist](https://packagist.org/packages/stfalcon-studio/api-bundle)[ Docs](https://github.com/stfalcon-studio/ApiBundle)[ RSS](/packages/stfalcon-studio-api-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (43)Versions (85)Used By (0)

ApiBundle
=========

[](#apibundle)

📦 Base classes and helper services to build API application via Symfony.

[![Scrutinizer Quality Score](https://camo.githubusercontent.com/d5142131a3320a5ee5c5f23fd49d83988c35a52bb19285e664895163ad454e4f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f737466616c636f6e2d73747564696f2f41706942756e646c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/stfalcon-studio/ApiBundle/)[![Build Status](https://camo.githubusercontent.com/675f3cad9619b00f225bfe8da0693059f1cb2d20808a3729470ee2fbcf61e29f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f737466616c636f6e2d73747564696f2f41706942756e646c652f63692e79616d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265)](https://github.com/stfalcon-studio/ApiBundle/actions?query=workflow%3ACI+branch%3Amain+)[![CodeCov](https://camo.githubusercontent.com/cde4f12de1cc412c616f524cd710e5202ac747a49e3fc5068759c1b715db010b/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f737466616c636f6e2d73747564696f2f41706942756e646c652e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/github/stfalcon-studio/ApiBundle)[![License](https://camo.githubusercontent.com/c724550bef130f2ea62ea7be4cdf22e7c7bd2e327106288bd8a15c9d060eceba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f737466616c636f6e2d73747564696f2f6170692d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stfalcon-studio/api-bundle)[![Latest Stable Version](https://camo.githubusercontent.com/f4e3270b63ffdbaaa1ebc99b982ccb509ae7a04691286f92d54dc0ab4a3ec612/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737466616c636f6e2d73747564696f2f6170692d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stfalcon-studio/api-bundle)[![Total Downloads](https://camo.githubusercontent.com/76f03f76befa7e48dea5116cbff504a05fe7ddf5dd1da82ba7e87c0487b88e66/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737466616c636f6e2d73747564696f2f6170692d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stfalcon-studio/api-bundle)[![StyleCI](https://camo.githubusercontent.com/1358641360235e1533a69b7b5c1af927f16b5b8d5110e4f81178c38482125cd5/68747470733a2f2f7374796c6563692e696f2f7265706f732f3235373937343134322f736869656c643f7374796c653d666c61742d737175617265)](https://styleci.io/repos/257974142)

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

[](#installation)

```
composer req stfalcon-studio/api-bundle

```

Add next dependencies if you want to use JWT auth

```
composer req gesdinet/jwt-refresh-token-bundle
composer req lexik/jwt-authentication-bundle

```

#### Check the `config/bundles.php` file

[](#check-the-configbundlesphp-file)

By default, Symfony Flex adds this bundle to the `config/bundles.php` file. In case when you ignored `contrib-recipe` during bundle installation it would not be added. In this case add the bundle manually.

```
# config/bundles.php

return [
    // Other bundles...
    StfalconStudio\ApiBundle\StfalconApiBundle::class => ['all' => true],
    // Other bundles...
];
```

Set Up Steps
------------

[](#set-up-steps)

#### Add mappings to Doctrine ORM config

[](#add-mappings-to-doctrine-orm-config)

```
doctrine:
  orm:
    mappings:
      StfalconApiBundle: ~
```

#### Set up a directory for JSON schemas

[](#set-up-a-directory-for-json-schemas)

The default directory is `./src/Json/Schema/`. Or you can change it via bundle configuration.

```
stfalcon_api:
  api_host: '%env(APP_API_HOST)%'
  json_schema_dir: '%kernel.project_dir%/src/Json/Schema/'
  jwt:
    enabled: true # set false to disable JWT auth
    redis_client_jwt_black_list: "@snc_redis.jwt_black_list"
```

Usage
=====

[](#usage)

Dictionary enums
----------------

[](#dictionary-enums)

For simple dictionary enums, you can use the `DictionaryEnumInteface` interface on Enums. It will register for serialization like a dictionary, so the result will be like:

```
{
  "id": 1,
  "value": "Enum name"
}
```

So, now the dictionary action will look like:

```
#[Route(path: '/foo/bar', name: 'foo_bar', methods: [Request::METHOD_GET])]
public function __invoke(): JsonResponse
{
    // ...

    return new JsonResponse(data: $this->serializer->serialize(FooBar::cases()), json: true);
}
```

In some cases, you may need to serialise dictionary value not as dictionary, for this just add in context parameter `default_normalization` with any value.

```
$this->serializer->serialize($fooBar, 'json', ['default_normalization' => true]);
```

Contributing
------------

[](#contributing)

Read the [CONTRIBUTING](https://github.com/stfalcon-studio/ApiBundle/blob/main/.github/CONTRIBUTING.md) file.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 87.6% 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 ~18 days

Recently: every ~8 days

Total

83

Last Release

714d ago

Major Versions

v0.18.2 → v1.4.32022-10-19

v1.6.0 → v2.0.02023-05-16

v2.3.0 → v3.0.02024-02-20

v2.3.1 → v3.0.32024-03-14

v2.x-dev → v3.1.02024-03-28

PHP version history (5 changes)0.1.0PHP &gt;=7.3

0.8.0PHP ^7.4

0.10.0PHP &gt;=7.4

v0.16.0PHP &gt;=8.1

v2.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/159215?v=4)[Stepan Tanasiychuk](/maintainers/stfalcon)[@stfalcon](https://github.com/stfalcon)

![](https://avatars.githubusercontent.com/u/815865?v=4)[Artem Henvald](/maintainers/fre5h)[@fre5h](https://github.com/fre5h)

---

Top Contributors

[![fre5h](https://avatars.githubusercontent.com/u/815865?v=4)](https://github.com/fre5h "fre5h (99 commits)")[![gabplch](https://avatars.githubusercontent.com/u/78665125?v=4)](https://github.com/gabplch "gabplch (5 commits)")[![metalslave](https://avatars.githubusercontent.com/u/23719326?v=4)](https://github.com/metalslave "metalslave (5 commits)")[![rela589n](https://avatars.githubusercontent.com/u/41589422?v=4)](https://github.com/rela589n "rela589n (3 commits)")[![devvitalii](https://avatars.githubusercontent.com/u/42313549?v=4)](https://github.com/devvitalii "devvitalii (1 commits)")

---

Tags

apibundlephpreststfalconsymfonysymfony-bundleapisymfonybundle

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/stfalcon-studio-api-bundle/health.svg)

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

###  Alternatives

[sylius/sylius

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

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

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

1.3k1.3M152](/packages/sulu-sulu)[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)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)

PHPackages © 2026

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