PHPackages                             alexanderallen/panettone - 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. alexanderallen/panettone

ActiveLibrary[API Development](/categories/api)

alexanderallen/panettone
========================

A lightweight PHP type generator for Open API (formerly Swagger)

0.2.3(1y ago)110[10 issues](https://github.com/AlexanderAllen/panettone/issues)GPL-3.0-or-laterPHP

Since May 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/AlexanderAllen/panettone)[ Packagist](https://packagist.org/packages/alexanderallen/panettone)[ Docs](https://github.com/AlexanderAllen/panettone)[ RSS](/packages/alexanderallen-panettone/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (8)Used By (0)

[![blackieshoot-IlbJvIia9aY-unsplash](panettone.jpg)](panettone.jpg)

Image by [@blackieshoot](https://unsplash.com/@blackieshoot) at [Unsplash](https://unsplash.com/)

[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/957becfcbaa6dbf67d2eb9c13bcc6d3915f8a8be7fa9e1d617989163c164d67f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f416c6578616e646572416c6c656e2f70616e6574746f6e652f7068702e796d6c)](https://camo.githubusercontent.com/957becfcbaa6dbf67d2eb9c13bcc6d3915f8a8be7fa9e1d617989163c164d67f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f416c6578616e646572416c6c656e2f70616e6574746f6e652f7068702e796d6c) [![Coveralls](https://camo.githubusercontent.com/f8b591f4f08f478884a8d25b282558c69853aa1f5937ff8913b2875b49ed2b46/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c73436f7665726167652f6769746875622f416c6578616e646572416c6c656e2f70616e6574746f6e653f7374796c653d666c6174266c6f676f3d636f766572616c6c73266c696e6b3d6874747073253341253246253246636f766572616c6c732e696f253246676974687562253246416c6578616e646572416c6c656e25324670616e6574746f6e65)](https://camo.githubusercontent.com/f8b591f4f08f478884a8d25b282558c69853aa1f5937ff8913b2875b49ed2b46/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c73436f7665726167652f6769746875622f416c6578616e646572416c6c656e2f70616e6574746f6e653f7374796c653d666c6174266c6f676f3d636f766572616c6c73266c696e6b3d6874747073253341253246253246636f766572616c6c732e696f253246676974687562253246416c6578616e646572416c6c656e25324670616e6574746f6e65) [![License](https://camo.githubusercontent.com/f3ba3ff5b12fd78eac3e114054c938c52b0732e1e09f7f02e496cf24d8e6069e/68747470733a2f2f706f7365722e707567782e6f72672f616c6578616e646572616c6c656e2f70616e6574746f6e652f6c6963656e7365)](https://packagist.org/packages/alexanderallen/panettone) [![Version](https://camo.githubusercontent.com/bc435dceeea986ba0ca67d2ecd2896ec0b79f7e20ccccd7cac2893a3e0f35820/687474703a2f2f706f7365722e707567782e6f72672f616c6578616e646572616c6c656e2f70616e6574746f6e652f76657273696f6e)](https://packagist.org/packages/alexanderallen/panettone)

Panettone
=========

[](#panettone)

Panettone is a CLI tool for extracting PHP types from [Open API](https://swagger.io/docs/specification/about/) schemas. Types are generated by interpreting the [data model](https://swagger.io/docs/specification/data-models/) (schema) of Open API documents. Unlike Api Platform's [schema generator](https://packagist.org/packages/api-platform/schema-generator), it does not determine types using [path and operations](https://swagger.io/docs/specification/paths-and-operations/).

Update September 2024
---------------------

[](#update-september-2024)

- Work in progress for [Use functional patterns when parsing Open API source](github.com/AlexanderAllen/panettone/issues/58)
- Work in progress for [0.2.4](https://github.com/AlexanderAllen/panettone/issues/57)

Update July 2024
----------------

[](#update-july-2024)

Pre-release [0.2.3](https://github.com/AlexanderAllen/panettone/releases/tag/0.2.3) introduces an initial set of functional structures to be used in the future for Open API parsing.

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

[](#installation)

```
composer require alexanderallen/panettone
vendor/bin/panettone --help

```

As Panettone is not a CLI tool and not a library, I recommend that you install it to your project's `tools` directory, as such:

```
mkdir -p tools
cd tools
composer require alexanderallen/panettone
cd ..
vendor/bin/panettone --help

```

Example
-------

[](#example)

```
vendor/bin/panettone schema/my-saucy-schema.yaml tmp vendor/alexanderallen/panettone/test/schema/settings.ini

```

In the example above, Panettone will:

- Source the `schema/my-saucy-schema.yaml` Open Api file;
- Output all generated types to the `tmp` directory, and;
- Use the settings in `vendor/alexanderallen/panettone/test/schema/settings.ini` to guide the type generation process.

Usage
-----

[](#usage)

```
vendor/bin/panettone --help

Description:
  Generate PHP types from Open API sources.

Usage:
  panettone  [ []]

Arguments:
  input                 Path to Open Api source file in YAML format
  output                Destination for generated files
  config                Path to .ini configuration file [default: "settings.ini"]

Options:
  -h, --help            Display help for the given command. When no command is given display help for the panettone command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  Generates PHP types from a Open API source.

```

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

[](#configuration)

Panettone is configured by placing a `settings.ini` in the directory from where you are executing Panettone, usually where your `composer.json` is.

Below is a list of the currently supported configuration options. Do note that the `[file], [class]` segments are required when using the options listed under them.

```
; Enable detailed logging during type generation.
debug = true

[file]
; Path where to dump the generated file.
output_path = "tmp"

; Namespace for all generated files.
namespace = "Panettone"

; Comment to apply to every generated file.
comment = "Example file comments are configured in settings.ini."

[class]
nullable = true
default = null

```

Testing
-------

[](#testing)

Tests are located in the `tests` directory. PHPUnit is installed separately in the `tools/phpunit` directory.

To test, first use Composer to install PHPUnit then run the test script.

```
composer -d tools/phpunit install
. tools/phpunit/test

```

Coverage
--------

[](#coverage)

Coverage details are gathered during testing in Github and [pushed to Coveralls](https://coveralls.io/github/AlexanderAllen/panettone).

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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 ~17 days

Total

6

Last Release

653d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d013669180c06037a371248f3b5555ac23ab2e526861693b75080e9ab2e114f8?d=identicon)[AlexanderAllen](/maintainers/AlexanderAllen)

---

Top Contributors

[![AlexanderAllen](https://avatars.githubusercontent.com/u/14018885?v=4)](https://github.com/AlexanderAllen "AlexanderAllen (300 commits)")

---

Tags

schemaswaggermodelentitydtodata transfer objectsopen-api

### Embed Badge

![Health badge](/badges/alexanderallen-panettone/health.svg)

```
[![Health](https://phpackages.com/badges/alexanderallen-panettone/health.svg)](https://phpackages.com/packages/alexanderallen-panettone)
```

###  Alternatives

[api-platform/schema-generator

Various tools to generate a data model based on Schema.org vocables

4714.2M7](/packages/api-platform-schema-generator)[phpexperts/simple-dto

A quick and easy DTO package.

521.1M7](/packages/phpexperts-simple-dto)[adrenalinkin/swagger-resolver-bundle

Provides possibility for validate data according to Swagger documentation

1013.3k](/packages/adrenalinkin-swagger-resolver-bundle)

PHPackages © 2026

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