For GenerationTarget::Client, the generator emits typed API clients with one of three HTTP transport styles.
| Adapter | Constructor Dependencies | Request Method | Good Choice For |
|---|---|---|---|
HttpClientAdapter::SymfonyHttpClient |
Symfony\Contracts\HttpClient\HttpClientInterface |
request() |
Symfony apps and lightweight clients |
HttpClientAdapter::Guzzle |
GuzzleHttp\ClientInterface |
request() + RequestOptions |
Existing Guzzle middleware stacks |
HttpClientAdapter::Psr18 |
Psr\Http\Client\ClientInterface, request factory, stream factory |
sendRequest() |
Portable libraries and framework-neutral code |
All adapters expose the same generated API signatures (*ApiClientInterface + *ApiClient).
generated/
|- Api/
| |- PetsApiClientInterface.php
| `- PetsApiClient.php
`- Model/
|- Pet.php
|- NewPet.php
`- ...
- path parameters are inserted without redundant concatenation fragments
- nullable query params are omitted from the final request
- request bodies use generated
toArray()output - response payloads are mapped back via generated
fromArray()methods voidoperations still execute HTTP calls and skip response deserialization
use MaxBeckers\OpenApiGenerator\Config\GenerationTarget;
use MaxBeckers\OpenApiGenerator\Config\HttpClientAdapter;
$config->generationTarget = GenerationTarget::Client;
$config->httpClient = HttpClientAdapter::SymfonyHttpClient; // symfony|guzzle|psr18