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

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

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

Apigility API Swagger documentation module

1.3.0(8y ago)11587.3k↓34.3%25[10 issues](https://github.com/zfcampus/zf-apigility-documentation-swagger/issues)[2 PRs](https://github.com/zfcampus/zf-apigility-documentation-swagger/pulls)3BSD-3-ClauseJavaScriptPHP ^5.6 || ^7.0

Since Feb 28Pushed 6y ago5 watchersCompare

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

READMEChangelog (3)Dependencies (11)Versions (18)Used By (3)

Swagger Documentation Provider for Apigility
============================================

[](#swagger-documentation-provider-for-apigility)

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

[![Build Status](https://camo.githubusercontent.com/896e2e821ded58c13bc09edaebf88ae8b83696b554bdbb4db6e2ae09f2a2bfbe/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f7a6663616d7075732f7a662d61706967696c6974792d646f63756d656e746174696f6e2d737761676765722e7376673f6272616e63683d6d6173746572)](https://secure.travis-ci.org/zfcampus/zf-apigility-documentation-swagger)[![Coverage Status](https://camo.githubusercontent.com/ded0e46a52aa3dee750f6c99ac866b3e4ec16ac5d709c24fe84777a1445db823/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7a6663616d7075732f7a662d61706967696c6974792d646f63756d656e746174696f6e2d737761676765722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/zfcampus/zf-apigility-documentation-swagger?branch=master)

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

[](#introduction)

This module provides Apigility the ability to show API documentation through a [Swagger UI](http://swagger.io/).

The Swagger UI is immediately accessible after enabling this module at the URI path `/apigility/swagger`.

In addition to providing the HTML UI, this module also plugs into the main Apigility documentation resource (at the path `/apigility/documentation`) in order to allow returning a documentation payload in the `application/vnd.swagger+json` media type; this resource is what feeds the Swagger UI. You can access this representation by passing the media type `application/vnd.swagger+json` for the `Accept` header via the path `/apigility/documentation/:module/:service`.

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

[](#requirements)

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

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

[](#installation)

Run the following `composer` command:

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

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

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

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\Swagger',
    ],
    /* ... */
];
```

> ### 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-swagger as a module for you.

Routes
------

[](#routes)

### /apigility/swagger

[](#apigilityswagger)

Shows the Swagger UI JavaScript application.

### Assets: `/zf-apigility-documentation-swagger/`

[](#assets-zf-apigility-documentation-swagger)

Various CSS, images, and JavaScript libraries required to deliver the Swagger UI client application.

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

[](#configuration)

### System Configuration

[](#system-configuration)

The following is required to ensure the module works within a ZF2 and/or Apigility-enabled application:

```
namespace ZF\Apigility\Documentation\Swagger;

return [
    'router' => [
        'routes' => [
            'zf-apigility' => [
                'child_routes' => [
                    'swagger' => [
                        'type' => 'segment',
                        'options' => [
                            'route'    => '/swagger',
                            'defaults' => [
                                'controller' => SwaggerUi::class,
                                'action'     => 'list',
                            ],
                        ],
                        'may_terminate' => true,
                        'child_routes' => [
                            'api' => [
                                'type' => 'segment',
                                'options' => [
                                    'route' => '/:api',
                                    'defaults' => [
                                        'action' => 'show',
                                    ],
                                ],
                                'may_terminate' => true,
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],

    'service_manager' => [
        'factories' => [
            SwaggerViewStrategy::class => SwaggerViewStrategyFactory::class,
        ],
    ],

    'controllers' => [
        'factories' => [
            SwaggerUi::class => SwaggerUiControllerFactory::class,
        ],
    ],

    'view_manager' => [
        'template_path_stack' => [
            'zf-apigility-documentation-swagger' => __DIR__ . '/../view',
        ],
    ],

    'asset_manager' => [
        'resolver_configs' => [
            'paths' => [
                __DIR__ . '/../asset',
            ],
        ],
    ],

    'zf-content-negotiation' => [
        'accept_whitelist' => [
            'ZF\Apigility\Documentation\Controller' => [
                0 => 'application/vnd.swagger+json',
            ],
        ],
        'selectors' => [
            'Documentation' => [
                ViewModel::class => [
                    'application/vnd.swagger+json',
                ],
            ],
        ],
    ],
];
```

ZF Events
---------

[](#zf-events)

### Listeners

[](#listeners)

#### ZF\\Apigility\\Documentation\\Swagger\\Module

[](#zfapigilitydocumentationswaggermodule)

This listener is attached to the `MvcEvent::EVENT_RENDER` event at priority `100`. Its purpose is to conditionally attach a view strategy to the view system in cases where the controller response is a `ZF\Apigility\Documentation\Swagger\ViewModel` view model (likely selected as the content-negotiated view model based off of `Accept` media types).

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

[](#zf-services)

### View Models

[](#view-models)

#### ZF\\Apigility\\Documentation\\Swagger\\ViewModel

[](#zfapigilitydocumentationswaggerviewmodel)

This view model is responsible for translating the available `ZF\Apigility\Documentation` models into Swagger-specific models, and further casting them to arrays for later rendering as JSON.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance2

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 82.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 ~109 days

Recently: every ~257 days

Total

15

Last Release

2933d ago

Major Versions

0.9.1 → 1.0.0beta12014-03-18

PHP version history (3 changes)0.9.0PHP &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 (127 commits)")[![ralphschindler](https://avatars.githubusercontent.com/u/76674?v=4)](https://github.com/ralphschindler "ralphschindler (17 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 (2 commits)")[![jguittard](https://avatars.githubusercontent.com/u/5320213?v=4)](https://github.com/jguittard "jguittard (1 commits)")[![abacaphiliac](https://avatars.githubusercontent.com/u/1656273?v=4)](https://github.com/abacaphiliac "abacaphiliac (1 commits)")[![bartbrinkman](https://avatars.githubusercontent.com/u/8309358?v=4)](https://github.com/bartbrinkman "bartbrinkman (1 commits)")[![ArnaudLigny](https://avatars.githubusercontent.com/u/80580?v=4)](https://github.com/ArnaudLigny "ArnaudLigny (1 commits)")

---

Tags

documentationswaggerZendFrameworkzfmoduleapigility

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[swagger-api/swagger-ui

 Swagger UI is a collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

28.8k45.4M99](/packages/swagger-api-swagger-ui)[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

2.9k34.0M112](/packages/darkaonline-l5-swagger)

PHPackages © 2026

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