Download the PHP package alexanderallen/panettone without Composer
On this page you can find all versions of the php package alexanderallen/panettone. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alexanderallen/panettone
More information about alexanderallen/panettone
Files in alexanderallen/panettone
Package panettone
Short Description A lightweight PHP type generator for Open API (formerly Swagger)
License GPL-3.0-or-later
Homepage https://github.com/AlexanderAllen/panettone
Informations about the package panettone
Image by @blackieshoot at Unsplash
Panettone
Panettone is a CLI tool for extracting PHP types from Open API schemas. Types are generated by interpreting the data model (schema) of Open API documents. Unlike Api Platform's schema generator, it does not determine types using path and operations.
Update September 2024
- Work in progress for Use functional patterns when parsing Open API source
- Work in progress for 0.2.4
Update July 2024
Pre-release 0.2.3 introduces an initial set of functional structures to be used in the future for Open API parsing.
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
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
vendor/bin/panettone --help
Description:
Generate PHP types from Open API sources.
Usage:
panettone <input> [<output> [<config>]]
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
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
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 details are gathered during testing in Github and pushed to Coveralls.
All versions of panettone with dependencies
symfony/console Version ^6.0
loophp/collection Version ^7.5
cebe/php-openapi Version ^1.7
nette/php-generator Version ^4.1
widmogrod/php-functional Version dev-master