Installation

Install the runtime and the generator, and know which one belongs in production.

Requirements

Install

The runtime goes in require, because generated code runs in production. The generator goes in require-dev, because it only runs while you generate:

composer require poagen/client-runtime
composer require --dev poagen/client-generator

The split is the point. A production install with --no-dev keeps the runtime and drops the generator, its OpenAPI parser and its code emitter.

Run the generator

Composer puts the binary in vendor/bin:

vendor/bin/poagen generate poagen.php

Or alias it in composer.json:

{
"scripts": {
"generate": "poagen generate poagen.php"
}
}

Then composer generate runs it.

Versions

poagen/client-runtime and poagen/client-generator are versioned separately. The generator’s release notes name the runtime range it needs. A client generated by one generator version keeps running with the runtime that version required, so upgrading the generator does not force a runtime upgrade until you regenerate.

From a checkout

Working on poagen itself is covered in CONTRIBUTING.md. From a checkout:

composer install
just check
vendor/bin/poagen generate examples/petstore/poagen.php

The generated examples are the shortest path to seeing what the output looks like on a real document. See Examples.