PHPackages                             application-bridge-slim/application-bridge-slim - 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. [Framework](/categories/framework)
4. /
5. application-bridge-slim/application-bridge-slim

ActiveLibrary[Framework](/categories/framework)

application-bridge-slim/application-bridge-slim
===============================================

Slim Application Bridge with the standard Application Bridge

1.0.0(8y ago)061LGPL-3.0-or-laterPHPPHP &gt;=5.3.0

Since Feb 21Pushed 8y ago1 watchersCompare

[ Source](https://github.com/virgiliolino/application-bridge-slim)[ Packagist](https://packagist.org/packages/application-bridge-slim/application-bridge-slim)[ Docs](https://github.com/virgiliolino/application-bridge-slim)[ RSS](/packages/application-bridge-slim-application-bridge-slim/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (4)Versions (2)Used By (0)

Open-api
========

[](#open-api)

Maybe it's about automation, or just about being more declarative because a non Touring complete DSL will just more be correct, I find it just amazing the possibility to describe an API by using the [Open-API-Specification](https://github.com/OAI/OpenAPI-Specification/blob/master/README.md) and let this specification be your code: this class will set every route using the Slim functionalities, and for every route point to a CommandHandler.

I'd suggest, the best way to see it in action is just to clone the repository and try the Example Hello World Application:

```
git clone git@github.com:virgiliolino/open-api.git
cd SwaggerSlimDispatcher/Examples/HelloWorld/
composer install   #composer install will actually install Slim and open-api
php -S localhost:8080 -t public public/index.php #start the server
curl localhost:8080/hello/world # or just open the browser localhost:8080/hello/world

```

For a fully working application, you could take a look at a ReactJS + Slim Skeleton that provides all the functionalities needed for a modern application. The url is [here](https://github.com/incubactor/slim-react-skeleton/)The OpenApi specification is [here](https://app.swaggerhub.com/apis/virgiliolino/slim-react-skeleton/1.0.0)

You will not have a few overpopulated Controllers, but instead for every entry point a command handler. You can read at this [blog post](https://jenssegers.com/85/goodbye-controllers-hello-request-handlers?utm_campaign=Revue%20newsletter&utm_medium=Newsletter&utm_source=A%20Semana%20PHP) for some ideas of how we intend our architecutre

Furthermore, the Open-Api specification can be automatically validated, tested [![Swagger](https://camo.githubusercontent.com/75a91bc738cb7a6c2536ed382fee9f5664f2380f6596c956defe31b3208b3b32/68747470733a2f2f323433347a6432396d697364336534613466316537336b692d7770656e67696e652e6e6574646e612d73736c2e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031362f31312f5377616767657248505f44657369676e2d2e706e67)](https://camo.githubusercontent.com/75a91bc738cb7a6c2536ed382fee9f5664f2380f6596c956defe31b3208b3b32/68747470733a2f2f323433347a6432396d697364336534613466316537336b692d7770656e67696e652e6e6574646e612d73736c2e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031362f31312f5377616767657248505f44657369676e2d2e706e67)

In the end you'll have a yml or json file that describe your API, something like this: [![Json Specification](https://raw.githubusercontent.com/virgiliolino/SwaggerSlimDispatcher/master/swagger.png)](https://raw.githubusercontent.com/virgiliolino/SwaggerSlimDispatcher/master/swagger.png)

By using our library all routes will automatically be set. Every route pointing to a CommandHandler indicated by a unique operationId. So in the image of the example, you can see that there is a route: /pet that accept post requests. It will be enough to use our class, when you start the application the route /pet will accept a post. And so for the gets that you see below, like /pet/findByStatus, etc. For every path, it will be executed the command handler with the operationI. In the example for /pet, you can see the **operationId: addPet**. So making a post request to /pet, the system will try to execute the class AddPet::execute passing the params. The operationId must be a fully qualified name of a class. Something like this for example: operationId: \\MyApplication\\CommandHandlers\\AddPett which means that will execue AddPett::execute

You may find an example of a fully working Open-Api specification [here](http://petstore.swagger.io/) [the full json file](http://petstore.swagger.io/v2/swagger.json)

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

[](#installation)

Even if its working, I'd not consider it really a *stable* package. So to install it you need to proceed in that way:

```
 composer require dispatcher/swagger-dispatcher dev-master

```

Examples/Helloworld
-------------------

[](#exampleshelloworld)

```
$app = new \Slim\App;
$container = $app->getContainer();
$container['HelloWorld'] = function () {
    return new \HelloWorld\CommandHandlers\HelloWorld();
};
$openApiFile = 'routes.json';
$openApiConfigParser = Bridge\ApplicationBridge\ParserFactory::parserFor($openApiFile);
$openApiConfig = $openApiConfigParser->parse($openApiFile);
\Bridge\ApplicationBridge\OpenApiDispatcher::InjectRoutesFromConfig($app, $openApiConfig);
$app->run();

```

As you may see we're injecting HelloWorld, a command Handler with the same id of operationId that you may find on routes.json

That's all folks.

Help wanted
-----------

[](#help-wanted)

There is no validation at all. This process can be automatized. Class *CommandHandler* on the file called *SwaggerDispatcher*.

Thanks, Virgilio

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

3003d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/750c7c313126d196e7b4670725a573a9b3d2976785f858fa7eac4ac83776b1af?d=identicon)[virgiliolino](/maintainers/virgiliolino)

---

Top Contributors

[![virgiliolino](https://avatars.githubusercontent.com/u/724429?v=4)](https://github.com/virgiliolino "virgiliolino (4 commits)")

---

Tags

frameworklaravelswaggeropenapisliminterfacebuilderroutedispatcher

### Embed Badge

![Health badge](/badges/application-bridge-slim-application-bridge-slim/health.svg)

```
[![Health](https://phpackages.com/badges/application-bridge-slim-application-bridge-slim/health.svg)](https://phpackages.com/packages/application-bridge-slim-application-bridge-slim)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M17.0k](/packages/laravel-framework)[slim/twig-view

Slim Framework 4 view helper built on top of the Twig 3 templating component

3708.0M210](/packages/slim-twig-view)[pecee/simple-router

Simple, fast PHP router that is easy to get integrated and in almost any project. Heavily inspired by the Laravel router.

696214.6k17](/packages/pecee-simple-router)[dragon-code/support

Support package is a collection of helpers and tools for any project.

238.7M101](/packages/dragon-code-support)[phphleb/webrotor

Asynchronous PHP web server for shared hosting

631.5k1](/packages/phphleb-webrotor)

PHPackages © 2026

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