PHPackages                             bradcrumb/ze-swagger-codegen - 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. bradcrumb/ze-swagger-codegen

ActiveLibrary[API Development](/categories/api)

bradcrumb/ze-swagger-codegen
============================

Zend Expressive Swagger codegen

01.3k3PHP

Since May 28Pushed 7y ago1 watchersCompare

[ Source](https://github.com/BradCrumb/ze-swagger-codegen)[ Packagist](https://packagist.org/packages/bradcrumb/ze-swagger-codegen)[ RSS](/packages/bradcrumb-ze-swagger-codegen/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Zend Expressive Swagger Codegen
===============================

[](#zend-expressive-swagger-codegen)

With this package you can easily generate Handlers, Models and Routes according to your OpenAPI Specification (OAS) 3.0 config.

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

[](#requirements)

- Zend Expressive +3.0

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

[](#installation)

`composer require bradcrumb/ze-swagger-codegen`

Usage
-----

[](#usage)

Simply place your `openapi.json` inside of your project root and run the following command:

`vendor/bin/swagger codegen`

By default the choosen namespace will be `App`. You can overwrite the namespace with the --namespace option:

`vendor/bin/swagger codegen --namespace MyOwnNamespace`

The CLI will search for the correct path inside of the composer autoloading. When a namespace is not registered for autoloading it will ask if the namespace folder have to be created and registered in `composer.json`.

Files
-----

[](#files)

The Codegen will generate the following files:

FileDescription`config/autoload/swagger.dependencies.global.php`Generated dependency and hydrators config`config/swagger.routes.php`Swagger routing config`*/Handler/*`Namespace to put all generated Handlers`*/Model/*`Namespace to put all generated Models`*/Hydrator/*`Namespace to put all generated HydratorsModel Middleware
----------------

[](#model-middleware)

Every route that requires a Model in its RequestBody has a prepended Middleware: `Swagger\Middleware\ModelMiddleware`.

The Middleware retrieves the RequestBody, hydrates the correct Model and validates the Model.

When the RequestBody is invalid it simply returns all errors messages for every property in a 400 response.

When the RequestBody is valid the hydrated model will be added as attribute to the request and can be retrieved inside the Handler:

`$request->getAttribute('Model');`

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4476936?v=4)[Brad Crumb](/maintainers/BradCrumb)[@BradCrumb](https://github.com/BradCrumb)

---

Top Contributors

[![BradCrumb](https://avatars.githubusercontent.com/u/4476936?v=4)](https://github.com/BradCrumb "BradCrumb (9 commits)")[![michielkalle](https://avatars.githubusercontent.com/u/14213930?v=4)](https://github.com/michielkalle "michielkalle (7 commits)")[![mjbarnhoorn](https://avatars.githubusercontent.com/u/1681950?v=4)](https://github.com/mjbarnhoorn "mjbarnhoorn (5 commits)")[![jeff-99](https://avatars.githubusercontent.com/u/3385333?v=4)](https://github.com/jeff-99 "jeff-99 (1 commits)")

### Embed Badge

![Health badge](/badges/bradcrumb-ze-swagger-codegen/health.svg)

```
[![Health](https://phpackages.com/badges/bradcrumb-ze-swagger-codegen/health.svg)](https://phpackages.com/packages/bradcrumb-ze-swagger-codegen)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)[emartech/emarsys-magento2-extension

Magento2 integration for the Emarsys Marketing Platform

14273.9k](/packages/emartech-emarsys-magento2-extension)

PHPackages © 2026

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