PHPackages                             zero-to-prod/data-model-adapter-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. zero-to-prod/data-model-adapter-swagger

ActiveLibrary

zero-to-prod/data-model-adapter-swagger
=======================================

Adapter for the Swagger 2.0 for DataModelGenerator

v0.2.3(2mo ago)1239MITPHPPHP &gt;=8.1.0CI passing

Since Jan 23Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/zero-to-prod/data-model-adapter-swagger)[ Packagist](https://packagist.org/packages/zero-to-prod/data-model-adapter-swagger)[ Docs](https://github.com/zero-to-prod/data-model-adapter-swagger)[ Fund](https://github.com/sponsors/zero-to-prod)[ RSS](/packages/zero-to-prod-data-model-adapter-swagger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (9)Versions (23)Used By (0)

Zerotoprod\\DataModelAdapterSwagger
===================================

[](#zerotoproddatamodeladapterswagger)

[![Repo](https://camo.githubusercontent.com/9a90a3efeee26aed7d7f2feee9cd84566a26f9c362cc773b184d076210906e1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769746875622d677261793f6c6f676f3d676974687562)](https://github.com/zero-to-prod/data-model-adapter-swagger)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/13038fc02befcf8decc1855de93abb0858e35b1d46a1ba54417d852d15078a52/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f646174612d6d6f64656c2d616461707465722d737761676765722f746573742e796d6c3f6c6162656c3d74657374)](https://github.com/zero-to-prod/data-model-adapter-swagger/actions)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/20120afd71bca69e7c88a8fa9b10d1ebd46a3155150fcf0d3d81c0240f941348/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f646174612d6d6f64656c2d616461707465722d737761676765722f6261636b77617264735f636f6d7061746962696c6974792e796d6c3f6c6162656c3d6261636b77617264735f636f6d7061746962696c697479)](https://github.com/zero-to-prod/data-model-adapter-swagger/actions)[![Packagist Downloads](https://camo.githubusercontent.com/1fc50b9e2209623a441f79a1055ada1c67e8d1ea76303916a12d043e566c0ae2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a65726f2d746f2d70726f642f646174612d6d6f64656c2d616461707465722d737761676765723f636f6c6f723d626c7565)](https://packagist.org/packages/zero-to-prod/data-model-adapter-swagger/stats)[![Packagist Version](https://camo.githubusercontent.com/01fb5340b62e6798379ae58282b85c4a73110ae399704d9f268ba3b8d892e408/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a65726f2d746f2d70726f642f646174612d6d6f64656c2d616461707465722d737761676765723f636f6c6f723d663238643161)](https://packagist.org/packages/zero-to-prod/data-model-adapter-swagger)[![License](https://camo.githubusercontent.com/408844c880fa634bd54c7ef63f9193f8f7b46ddcf7ccfe2f2daf87f247060a46/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7a65726f2d746f2d70726f642f646174612d6d6f64656c2d616461707465722d737761676765723f636f6c6f723d726564)](https://github.com/zero-to-prod/data-model-adapter-swagger/blob/main/LICENSE.md)[![wakatime](https://camo.githubusercontent.com/3291720d24be26bd7722c5a17cd77646e6f84755d5af0b77945ae3aecc83baa1/68747470733a2f2f77616b6174696d652e636f6d2f62616467652f6769746875622f7a65726f2d746f2d70726f642f646174612d6d6f64656c2d616461707465722d737761676765722e737667)](https://wakatime.com/badge/github/zero-to-prod/data-model-adapter-swagger)[![Hits-of-Code](https://camo.githubusercontent.com/7c6aedb33f1d55f670370dcee07bc738c40e4172aee5cb3193562ffe018fbb41/68747470733a2f2f686974736f66636f64652e636f6d2f6769746875622f7a65726f2d746f2d70726f642f646174612d6d6f64656c2d616461707465722d737761676765723f6272616e63683d6d61696e)](https://hitsofcode.com/github/zero-to-prod/data-model-adapter-swagger/view?branch=main)

Contents
--------

[](#contents)

- [Introduction](#introduction)
- [Requirements](#requirements)
- [Installation](#installation)
- [Documentation Publishing](#documentation-publishing)
    - [Automatic Documentation Publishing](#automatic-documentation-publishing)
- [Local Development](./LOCAL_DEVELOPMENT.md)
- [Contributing](#contributing)

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

[](#introduction)

Adapter for the Swagger 2.0 for [DataModelGenerator](https://github.com/zero-to-prod/data-model-generator).

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

[](#requirements)

- PHP 8.1 or higher.

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

[](#installation)

You can install this package via Composer.

```
composer require zero-to-prod/data-model-adapter-swagger
```

Documentation Publishing
------------------------

[](#documentation-publishing)

You can publish this README to your local documentation directory.

This can be useful for providing documentation for AI agents.

This can be done using the included script:

```
# Publish to default location (./docs/zero-to-prod/data-model-adapter-swagger)
vendor/bin/zero-to-prod-data-model-adapter-swagger

# Publish to custom directory
vendor/bin/zero-to-prod-data-model-adapter-swagger /path/to/your/docs
```

### Automatic Documentation Publishing

[](#automatic-documentation-publishing)

You can automatically publish documentation by adding the following to your `composer.json`:

```
{
    "scripts": {
        "post-install-cmd": [
            "zero-to-prod-data-model-adapter-swagger"
        ],
        "post-update-cmd": [
            "zero-to-prod-data-model-adapter-swagger"
        ]
    }
}
```

Usage
-----

[](#usage)

Generate components from a Swagger 2.0 schema.

```
namespace Zerotoprod\DataModelAdapterSwagger;

$Components = Swagger::adapt(file_get_contents(__DIR__.'/schema.json'))
```

This will add the package to your project’s dependencies and create an autoloader entry for it.

Contributing
------------

[](#contributing)

Contributions, issues, and feature requests are welcome! Feel free to check the [issues](https://github.com/zero-to-prod/data-model-adapter-swagger/issues) page if you want to contribute.

1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Commit changes (`git commit -m 'Add some feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Create a new Pull Request.

###  Health Score

41

—

FairBetter than 88% of packages

Maintenance89

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~18 days

Recently: every ~41 days

Total

22

Last Release

87d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/502649f05d36c87d494988bd99193a4d908d345335d99c080928a726277371f5?d=identicon)[zero-to-prod](/maintainers/zero-to-prod)

---

Top Contributors

[![zero-to-prod](https://avatars.githubusercontent.com/u/61474950?v=4)](https://github.com/zero-to-prod "zero-to-prod (13 commits)")

---

Tags

zero-to-prodDataModelAdapterSwaggerdata-model-adapter-swagger

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zero-to-prod-data-model-adapter-swagger/health.svg)

```
[![Health](https://phpackages.com/badges/zero-to-prod-data-model-adapter-swagger/health.svg)](https://phpackages.com/packages/zero-to-prod-data-model-adapter-swagger)
```

###  Alternatives

[zero-to-prod/data-model

Transforms Data into Type-Safe DTOs.

14226.2k32](/packages/zero-to-prod-data-model)

PHPackages © 2026

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