PHPackages                             zfcampus/zf-apigility-documentation - 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. zfcampus/zf-apigility-documentation

Abandoned → [laminas-api-tools/api-tools-documentation](/?search=laminas-api-tools%2Fapi-tools-documentation)ArchivedLibrary[API Development](/categories/api)

zfcampus/zf-apigility-documentation
===================================

Apigility API documentation module

1.3.0(8y ago)121.4M—1.3%33[13 issues](https://github.com/zfcampus/zf-apigility-documentation/issues)[1 PRs](https://github.com/zfcampus/zf-apigility-documentation/pulls)6BSD-3-ClausePHPPHP ^5.6 || ^7.0

Since Feb 21Pushed 6y ago6 watchersCompare

[ Source](https://github.com/zfcampus/zf-apigility-documentation)[ Packagist](https://packagist.org/packages/zfcampus/zf-apigility-documentation)[ RSS](/packages/zfcampus-zf-apigility-documentation/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (12)Versions (23)Used By (6)

ZF Apigility Documentation
==========================

[](#zf-apigility-documentation)

> ## Repository abandoned 2019-12-31
>
> [](#repository-abandoned-2019-12-31)
>
> This repository has moved to [laminas-api-tools/api-tools-documentation](https://github.com/laminas-api-tools/api-tools-documentation).

[![Build Status](https://camo.githubusercontent.com/4057bde48d92fa9026e5f6b8ee5017800ac29899ccd94f75599f9e531f536ad7/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f7a6663616d7075732f7a662d61706967696c6974792d646f63756d656e746174696f6e2e7376673f6272616e63683d6d6173746572)](https://secure.travis-ci.org/zfcampus/zf-apigility-documentation)[![Coverage Status](https://camo.githubusercontent.com/d796f4038591ba19269de8b367b0037246979ce6840624d15666acb8d85d2933/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7a6663616d7075732f7a662d61706967696c6974792d646f63756d656e746174696f6e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/zfcampus/zf-apigility-documentation?branch=master)

Introduction
------------

[](#introduction)

This Zend Framework module can be used with conjunction with Apigility in order to:

- provide an object model of all captured documentation information, including:
    - All APIs available.
    - All *services* available in each API.
    - All *operations* available for each service.
    - All required/expected `Accept` and `Content-Type` request headers, and expected `Content-Type` response header, for each available operation.
    - All configured fields for each service.
- provide a configurable MVC endpoint for returning documentation.
    - documentation will be delivered in both HTML or serialized JSON by default.
    - end-users may configure alternate/additional formats via content-negotiation.

This module accomplishes all the above use cases by providing an endpoint to connect to (`/apigility/documentation[/:api[-v:version][/:service]]`), using content-negotiation to provide both HTML and JSON representations.

Requirements
------------

[](#requirements)

Please see the [composer.json](composer.json) file.

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

[](#installation)

Run the following `composer` command:

```
$ composer require zfcampus/zf-apigility-documentation
```

Alternately, manually add the following to your `composer.json`, in the `require` section:

```
"require": {
    "zfcampus/zf-apigility-documentation": "^1.2-dev"
}
```

And then run `composer update` to ensure the module is installed.

Finally, add the module name to your project's `config/application.config.php` under the `modules`key:

```
return [
    /* ... */
    'modules' => [
        /* ... */
        'ZF\Apigility\Documentation',
    ],
    /* ... */
];
```

> ### zf-component-installer
>
> [](#zf-component-installer)
>
> If you use [zf-component-installer](https://github.com/zendframework/zf-component-installer), that plugin will install zf-apigility-documentation as a module for you.

Configuration
-------------

[](#configuration)

### User Configuration

[](#user-configuration)

This module does not utilize any user configuration.

### System Configuration

[](#system-configuration)

The following configuration is defined by the module to ensure operation within a Zend Framework 2 MVC application.

```
namespace ZF\Apigility\Documentation;

use Zend\ServiceManager\Factory\InvokableFactory;
use Zend\View\Model\ViewModel;

return [
    'router' => [
        'routes' => [
            'zf-apigility' => [
                'child_routes' => [
                    'documentation' => [
                        'type' => 'segment',
                        'options' => [
                            'route'    => '/documentation[/:api[-v:version][/:service]]',
                            'constraints' => [
                                'api' => '[a-zA-Z][a-zA-Z0-9_.]+',
                            ],
                            'defaults' => [
                                'controller' => Controller::class,
                                'action'     => 'show',
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
    'service_manager' => [
        'factories' => [
            ApiFactory::class => Factory\ApiFactoryFactory::class,
        ],
    ],
    'controllers' => [
        'factories' => [
            Controller::class => ControllerFactory::class,
        ],
    ],
    'zf-content-negotiation' => [
        'controllers' => [
            Controller::class => 'Documentation',
        ],
        'accept_whitelist' => [
            Controller::class => [
                0 => 'application/vnd.swagger+json',
                1 => 'application/json',
            ],
        ],
        'selectors' => [
            'Documentation' => [
                ViewModel::class => [
                    'text/html',
                    'application/xhtml+xml',
                ],
                JsonModel::class => [
                    'application/json',
                ],
            ],
        ],
    ],
    'view_helpers' => [
        'aliases' => [
            'agacceptheaders'         => View\AgAcceptHeaders::class,
            'agAcceptHeaders'         => View\AgAcceptHeaders::class,
            'agcontenttypeheaders'    => View\AgContentTypeHeaders::class,
            'agContentTypeHeaders'    => View\AgContentTypeHeaders::class,
            'agservicepath'           => View\AgServicePath::class,
            'agServicePath'           => View\AgServicePath::class,
            'agstatuscodes'           => View\AgStatusCodes::class,
            'agStatusCodes'           => View\AgStatusCodes::class,
            'agtransformdescription'  => View\AgTransformDescription::class,
            'agTransformDescription'  => View\AgTransformDescription::class,
        ],
        'factories' => [
            View\AgAcceptHeaders::class        => InvokableFactory::class,
            View\AgContentTypeHeaders::class   => InvokableFactory::class,
            View\AgServicePath::class          => InvokableFactory::class,
            View\AgStatusCodes::class          => InvokableFactory::class,
            View\AgTransformDescription::class => InvokableFactory::class,
        ],
    ],
    'view_manager' => [
        'template_path_stack' => [
            __DIR__ . '/../view',
        ],
    ],
];
```

ZF Events
---------

[](#zf-events)

This module has no events or listeners.

ZF Services
-----------

[](#zf-services)

### View Helpers

[](#view-helpers)

The following list of view helpers assist in making API documentation models presentable in view scripts.

- `ZF\Apigility\Documentation\View\AgAcceptHeaders` (a.k.a `agAcceptHeaders`) for making a list of `Accept` headers, escaped for HTML.
- `ZF\Apigility\Documentation\View\AgContentTypeHeaders` (a.k.a `agContentTypeHeaders`) for making a list of `Content-Type` headers, escaped for HTML.
- `ZF\Apigility\Documentation\View\AgServicePath` (a.k.a `agServicePath`) for making an HTML view representation of the route configuration of a service path.
- `ZF\Apigility\Documentation\View\AgStatusCodes` (a.k.a `agStatusCodes`) for making an escaped list of status codes and their messages.
- `ZF\Apigility\Documentation\View\AgTransformDescription` (a.k.a `agTransformDescription`) for transforming the written descriptions into Markdown.

### Factories

[](#factories)

#### ZF\\Apigility\\Documentation\\ApiFactory

[](#zfapigilitydocumentationapifactory)

The `ApiFactory` service is capable of producing an object-graph representation of the desired API documentation that is requested. This object-graph will be composed of the following types:

- `ZF\Apigility\Documentation\Api`: the root node of an API.
- `ZF\Apigility\Documentation\Services`: an array of services in the API (a service can be one of a REST or RPC style service).
- `ZF\Apigility\Documentation\Operations`: an array of operations in the service.
- `ZF\Apigility\Documentation\Fields`: an array of fields for a service.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community33

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 77.5% 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 ~85 days

Recently: every ~165 days

Total

19

Last Release

2933d ago

Major Versions

0.9.0 → 1.0.0beta12014-03-21

PHP version history (3 changes)0.9.1PHP &gt;=5.3.23

1.1.0PHP &gt;=5.5

1.2.0PHP ^5.6 || ^7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/296074?v=4)[Zend Framework](/maintainers/zendframework)[@zendframework](https://github.com/zendframework)

---

Top Contributors

[![weierophinney](https://avatars.githubusercontent.com/u/25943?v=4)](https://github.com/weierophinney "weierophinney (207 commits)")[![ralphschindler](https://avatars.githubusercontent.com/u/76674?v=4)](https://github.com/ralphschindler "ralphschindler (20 commits)")[![tasselchof](https://avatars.githubusercontent.com/u/7921861?v=4)](https://github.com/tasselchof "tasselchof (5 commits)")[![abacaphiliac](https://avatars.githubusercontent.com/u/1656273?v=4)](https://github.com/abacaphiliac "abacaphiliac (4 commits)")[![bgaillard](https://avatars.githubusercontent.com/u/1327782?v=4)](https://github.com/bgaillard "bgaillard (4 commits)")[![michalbundyra](https://avatars.githubusercontent.com/u/7423207?v=4)](https://github.com/michalbundyra "michalbundyra (4 commits)")[![neeckeloo](https://avatars.githubusercontent.com/u/1768645?v=4)](https://github.com/neeckeloo "neeckeloo (3 commits)")[![rodsouto](https://avatars.githubusercontent.com/u/1918738?v=4)](https://github.com/rodsouto "rodsouto (3 commits)")[![YonmaNBehalf](https://avatars.githubusercontent.com/u/10613680?v=4)](https://github.com/YonmaNBehalf "YonmaNBehalf (3 commits)")[![ezimuel](https://avatars.githubusercontent.com/u/475967?v=4)](https://github.com/ezimuel "ezimuel (3 commits)")[![disasterdrop](https://avatars.githubusercontent.com/u/472591?v=4)](https://github.com/disasterdrop "disasterdrop (2 commits)")[![xjchengo](https://avatars.githubusercontent.com/u/4819996?v=4)](https://github.com/xjchengo "xjchengo (2 commits)")[![jguittard](https://avatars.githubusercontent.com/u/5320213?v=4)](https://github.com/jguittard "jguittard (1 commits)")[![jackdpeterson](https://avatars.githubusercontent.com/u/938961?v=4)](https://github.com/jackdpeterson "jackdpeterson (1 commits)")[![kaloyan-raev](https://avatars.githubusercontent.com/u/468091?v=4)](https://github.com/kaloyan-raev "kaloyan-raev (1 commits)")[![koodikindral](https://avatars.githubusercontent.com/u/6285484?v=4)](https://github.com/koodikindral "koodikindral (1 commits)")[![pavkatar](https://avatars.githubusercontent.com/u/259746?v=4)](https://github.com/pavkatar "pavkatar (1 commits)")[![ricardofiorani](https://avatars.githubusercontent.com/u/1641075?v=4)](https://github.com/ricardofiorani "ricardofiorani (1 commits)")[![bartbrinkman](https://avatars.githubusercontent.com/u/8309358?v=4)](https://github.com/bartbrinkman "bartbrinkman (1 commits)")

---

Tags

documentationZendFrameworkzfmoduleapigiltiy

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zfcampus-zf-apigility-documentation/health.svg)

```
[![Health](https://phpackages.com/badges/zfcampus-zf-apigility-documentation/health.svg)](https://phpackages.com/packages/zfcampus-zf-apigility-documentation)
```

PHPackages © 2026

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