PHP REST client generator for OpenAPI™
Hand over an OpenAPI specification and get a finished Composer package back — typed models, a client, the operations and the authentication, plus a manifest, a LICENSE and a README.
Free. There is nothing to buy and nothing to unlock.
What you get
A standalone package that installs like any other — an SDK, not a folder full of snippets.
Client and configuration
One entry point holding the base URL, the HTTP client and the credentials.
Typed models
Every schema in the specification as a PHP class, instead of arrays keyed by strings.
Operations and parameters
One class per operation, with objects of their own for query, header and form parameters.
Authentication
The schemes the document declares — with examples, where it allows any.
Runtime included
The HTTP layer sits inside the package itself. Nothing alongside it to version separately.
Manifest and paperwork
composer.json, LICENSE, README and examples — and the manifest names only what the generated code actually needs.
Clean code is the aim, not an accident
The generator itself is checked against PHPStan at its highest level, with several strict extra rule sets on top, and against Psalm at its strictest. The same yardstick is held against what comes out of it.
None of that promises that every generated line clears every project and every analysis configuration without a finding. It is the standard the generator has to be measured against.
- Typed throughout
- declare(strict_types=1) in every file, types on every parameter and every return value, and PHPDoc generics wherever PHP itself stops being precise enough.
- Immutable
- final readonly classes without setters. Changes go through a builder: toBuilder() takes the values over, build() returns a new object — a model never changes under your hands.
- No puzzling null
- An optional field gets a type of its own. Whether a value is missing or deliberately empty is stated in the type rather than in a comment.
Better still, read it yourself
A fully generated package, not an excerpt: 62 models, 7 operations and over 200 files — client, authentication, validation, manifest, LICENSE and examples. Generated from the public specification of the DHL Parcel DE Shipping API (Post & Parcel Germany).
An unofficial client, generated from a publicly documented interface — not published by DHL and not endorsed by DHL.
How it goes
Three steps, and the middle one is where you can still change your mind.
Hand over the specification
Upload the file. YAML or JSON, either is fine.
Look at what is in it
Before anything is generated, the document is read: title, version, operations, paths, security schemes, warnings. The package name and namespace are suggested from it — you can overrule them.
Collect the package
As a zip to download, or committed straight into your own GitHub repository.
Worth knowing
- OpenAPI 2.0 through 3.2
- Which version you have is read from the document rather than asked for. 2.0, 3.0, 3.1 and 3.2 are understood.
- Up to 5 MB per document
- Anything larger is not accepted.
- A zip, or your repository
- Without GitHub you get an archive. With GitHub the package is committed into a repository you pick.
- Later releases are measured
- When a package goes into the same repository a second time, what changed in its public surface is compared first. The version number follows from that — confirming it stays yours.
- Only real dependencies
- The generated composer.json names what the code uses, not everything the generator is capable of.
- No Java toolchain
- Nothing to install to generate: no JAR, no Docker image, no runtime beside the one you already write in. The generating happens here.
- The package is yours
- The Composer vendor and the copyright line in the LICENSE come from your account. My name appears nowhere in it.
Common questions
- What does it cost?
- Nothing. There is no plan, no limit that could be bought away, and nothing that expires after a while.
- Who owns the generated package?
- You do. The Composer vendor and the copyright holder in the LICENSE are resolved from your account, not mine — you can publish it, rename it or throw it away without asking anyone.
- What happens to my specification?
- It stays in your account until you delete the request — at which point it goes, along with the package built from it. What is stored in detail is set out in the privacy policy. Read the privacy policy
- Which OpenAPI versions are read?
- OpenAPI 2.0, 3.0, 3.1 and 3.2. The generator works out which one you have from the document itself.
- Do I need a GitHub account?
- No. Without GitHub you get a zip. Connect one and the package can be committed into a repository of your choosing instead.
- Wasn't this called Swagger?
- OpenAPI 2.0 is the former Swagger specification 2.0. If your document identifies itself as one, it belongs here.
