PHPackages                             reliv/pipe-rat-2 - 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. reliv/pipe-rat-2

ActiveLibrary[HTTP &amp; Networking](/categories/http)

reliv/pipe-rat-2
================

Create REST APIs with just a few lines of Expressive config. This PSR7 compliant PHP library that uses Zend Expressive Middleware at its core.

0.9.0(6y ago)03172BSD-3-ClausePHPPHP &gt;=7

Since Oct 10Pushed 6y ago6 watchersCompare

[ Source](https://github.com/reliv/pipe-rat-2)[ Packagist](https://packagist.org/packages/reliv/pipe-rat-2)[ Docs](https://github.com/reliv/pipe-rat-2)[ RSS](/packages/reliv-pipe-rat-2/feed)WikiDiscussions master Synced today

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

Pipe Rat
========

[](#pipe-rat)

Create REST APIs with just a few lines of Expressive config. This PSR7 compliant PHP library that uses Zend\\Expressive Middleware config at its core.

- Allows creation of API end points using only config for Doctrine entities
- Allows configuration of common API concerns:
    - data-extractor - Getting arrays from data objects and object arrays
    - data-hydrator - Getting data from client into data objects and arrays
    - data-validate - Validating data from client
    - repository - Common repository methods
    - request-attributes - Common query params ('where', 'fields', 'limit', 'order', 'skip', etc...)
    - request-attributes-validate - Validate the params
    - request-format - Data format parsing the request data
    - response-format - Data format for response (JSON, etc...)
    - response-headers - Common headers for response (caching etc...)

Config example
--------------

[](#config-example)

```
'routes' => [
    /* Put your path here */
    'my.thing.find' => [
        /* Use standard route names for client simplicity */
        'name' => 'my.thing.find',

        /* Use standard route paths for client simplicity */
        'path' => 'my/thing',

        /* Wire each API independently */
        'middleware' => [
            RequestFormat::configKey()
            => RequestFormat::class,

            RequestAcl::configKey()
            => RequestAcl::class,

            RequestAttributes::configKey()
            => RequestAttributes::class,

            RequestAttributesValidate::configKey()
            => RequestAttributesValidate::class,

            /**  */
            ResponseHeaders::configKey()
            => ResponseHeaders::class,

            ResponseFormat::configKey()
            => ResponseFormat::class,

            ResponseDataExtractor::configKey()
            => ResponseDataExtractor::class,
            /**  */

            RepositoryFind::configKey()
            => RepositoryFind::class,
        ],

        /* Use route to find options at runtime */
        'options' => [
            RequestFormat::configKey() => [
                RequestFormat::OPTION_SERVICE_NAME
                => WithParsedBodyJson::class,

                RequestFormat::OPTION_SERVICE_OPTIONS => [],
            ],

            RequestAcl::configKey() => [
                RequestAcl::OPTION_SERVICE_NAME
                => IsAllowedNotConfigured::class,

                RequestAcl::OPTION_SERVICE_OPTIONS => [
                    IsAllowedNotConfigured::OPTION_MESSAGE
                    => IsAllowedNotConfigured::DEFAULT_MESSAGE
                        . ' for pipe-rat-2 resource: "{pipe-rat-2-config.resource-name}"'
                        . ' in file: "{pipe-rat-2-config.source-config-file}"',
                ],
            ],

            RequestAttributes::configKey() => [
                RequestAttributes::OPTION_SERVICE_NAMES => [
                    WithRequestAttributeFields::class
                    => WithRequestAttributeUrlEncodedFields::class,

                    WithRequestAttributeAllowedFieldConfig::class
                    => WithRequestAttributeAllowedFieldConfigFromOptions::class,

                    WithRequestAttributeExtractorFieldConfig::class
                    => WithRequestAttributeExtractorFieldConfigByRequestFields::class,

                    WithRequestAttributeWhere::class
                    => WithRequestAttributeUrlEncodedWhere::class,

                    WithRequestAttributeWhereMutator::class
                    => WithRequestAttributeWhereMutatorNoop::class,

                    WithRequestAttributeOrder::class
                    => WithRequestAttributeUrlEncodedOrder::class,

                    WithRequestAttributeSkip::class
                    => WithRequestAttributeUrlEncodedSkip::class,

                    WithRequestAttributeLimit::class
                    => WithRequestAttributeUrlEncodedLimit::class,
                ],

                RequestAttributes::OPTION_SERVICE_NAMES_OPTIONS => [
                    WithRequestAttributeAllowedFieldConfig::class => [
                        WithRequestAttributeAllowedFieldConfigFromOptions::OPTION_ALLOWED_FIELDS
                        /* @todo Over-ride with YOUR FieldsConfig */
                        => [
                            FieldConfig::KEY_TYPE => FieldConfig::COLLECTION,
                            FieldConfig::KEY_PROPERTIES => [],
                            FieldConfig::KEY_INCLUDE => true,
                        ],
                    ]
                ],
            ],

            RequestAttributesValidate::configKey() => [
                RequestAttributesValidate::OPTION_SERVICE_NAME
                => WithRequestValidAttributesAsserts::class,
            ],

            /**  */
            ResponseHeaders::configKey() => [
                ResponseHeaders::OPTION_SERVICE_NAME
                => WithResponseHeadersAdded::class,

                ResponseHeaders::OPTION_SERVICE_OPTIONS => [
                    WithResponseHeadersAdded::OPTION_HEADERS => []
                ],
            ],

            ResponseFormat::configKey() => [
                ResponseFormat::OPTION_SERVICE_NAME
                => WithFormattedResponseJson::class,

                ResponseFormat::OPTION_SERVICE_OPTIONS => [],
            ],

            ResponseDataExtractor::configKey() => [
                ResponseDataExtractor::OPTION_SERVICE_NAME => ExtractByType::class,
            ],
            /**  */

            RepositoryFind::configKey() => [
                RepositoryFind::OPTION_SERVICE_NAME
                => FindNotConfigured::class,

                RepositoryFind::OPTION_SERVICE_OPTIONS => [
                    FindNotConfigured::OPTION_MESSAGE
                    => FindNotConfigured::DEFAULT_MESSAGE
                        . ' for pipe-rat-2 resource: "{pipe-rat-2-config.resource-name}"'
                        . ' in file: "{pipe-rat-2-config.source-config-file}"',
                ],
            ],
        ],

        /* Use to define allowed methods */
        'allowed_methods' => ['GET'],
    ],
],
```

###  Health Score

29

—

LowBetter than 63% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 72.2% 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 ~65 days

Recently: every ~6 days

Total

13

Last Release

2298d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d89ed9b1fb36217e63fbabed855b75ccbca9a740b8662ed44aa982d5d7c98f7?d=identicon)[reliv](/maintainers/reliv)

---

Top Contributors

[![rodmcnew](https://avatars.githubusercontent.com/u/1828506?v=4)](https://github.com/rodmcnew "rodmcnew (13 commits)")[![bradharms](https://avatars.githubusercontent.com/u/1239044?v=4)](https://github.com/bradharms "bradharms (5 commits)")

---

Tags

middlewareapirestzendmoduleexpressivereliv

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/reliv-pipe-rat-2/health.svg)

```
[![Health](https://phpackages.com/badges/reliv-pipe-rat-2/health.svg)](https://phpackages.com/packages/reliv-pipe-rat-2)
```

###  Alternatives

[elementaryframework/water-pipe

URL routing framework and requests/responses handler for PHP

254.2k4](/packages/elementaryframework-water-pipe)

PHPackages © 2026

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