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 6y 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 2d 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 27% 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://www.gravatar.com/avatar/376972f1f11ca42dbb67dc764af57d7c051d18d69e67a8ccb7c1018b06ad3d77?d=identicon)[BradCrumb](/maintainers/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

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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