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
`- ...
toArray() outputfromArray() methodsvoid operations still execute HTTP calls and skip response deserializationuse MaxBeckers\OpenApiGenerator\Config\GenerationTarget;
use MaxBeckers\OpenApiGenerator\Config\HttpClientAdapter;
$config->generationTarget = GenerationTarget::Client;
$config->httpClient = HttpClientAdapter::SymfonyHttpClient; // symfony|guzzle|psr18
$config->httpClientVersion = '7.0'; // optional, when adapter majors require different generated code
Leave $config->httpClientVersion as null if you do not need adapter-version-specific generation yet.