PHPackages                             tcds-io/php-jackson-guzzle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. tcds-io/php-jackson-guzzle

ActiveLibrary[HTTP &amp; Networking](/categories/http)

tcds-io/php-jackson-guzzle
==========================

A Guzzle plugin that parses request objects into json and response into objects

1.1.0(3mo ago)0480↓33.3%MITPHPPHP ^8.4CI passing

Since Jan 14Pushed 3mo agoCompare

[ Source](https://github.com/tcds-io/php-jackson-guzzle)[ Packagist](https://packagist.org/packages/tcds-io/php-jackson-guzzle)[ RSS](/packages/tcds-io-php-jackson-guzzle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (4)Used By (0)

PHP Jackson for Guzzle
======================

[](#php-jackson-for-guzzle)

Guzzle integration for [tcds-io/php-jackson](https://github.com/tcds-io/php-jackson), a type-safe object mapper inspired by Jackson (Java).

This package provides a **typed HTTP client** built on top of Guzzle that automatically maps JSON responses into strongly-typed PHP objects --- both synchronously and asynchronously.

---

✨ Features
----------

[](#-features)

- Typed object mapping for HTTP responses
- Full async support with typed promises
- Works seamlessly with immutable and readonly DTOs
- Keeps the native Guzzle client fully accessible
- Built on top of php-jackson for consistent serialization rules

---

🚀 Installation
--------------

[](#-installation)

```
composer require tcds-io/php-jackson-guzzle
```

---

⚙️ How it works
---------------

[](#️-how-it-works)

1. You specify the DTO class and your guzzle request information.
2. JacksonClient sends HTTP requests via Guzzle.
3. JSON responses are automatically deserialized into your DTOs.
4. Async calls return typed promises.

---

🧩 Basic Usage
-------------

[](#-basic-usage)

```
use Jackson\JacksonClient;
use GuzzleHttp\Client;

$client = new JacksonClient(
    new Client([
        'base_uri' => 'https://api.example.com',
    ]),
);
```

### Typed GET

[](#typed-get)

```
// Dto
readonly class Address
{
    public function __construct(
        public string $id,
        public string $street,
        public int $number,
        public bool $main,
    ) {}
}

// Request
$address = $client->get(Address::class, '/addresses/aaa');
```

### Typed POST

[](#typed-post)

```
// Dto
readonly class AddressCreated
{
    public function __construct(public string $id) {}
}

// Request
$created = $client->post(AddressCreated::class, '/addresses', [
    RequestOptions::JSON => ['street' => 'Ocean Avenue', 'number' => 42],
]);
```

---

⚡ Async
-------

[](#-async)

```
$address = $client
    ->getAsync(Address::class, '/addresses/aaa')
    ->wait();
```

---

🛠 Configuring Serializable Objects
----------------------------------

[](#-configuring-serializable-objects)

While most DTOs work out of the box, some require custom deserialization rules.

JacksonClient exposes the underlying object mapper so you can define custom type mappers for full control over how JSON is converted into objects.

```
use Jackson\JacksonClient;
use GuzzleHttp\Client;

$client = new JacksonClient(
    guzzle: new Client([
        'base_uri' => 'https://api.example.com',
    ]),
    mapper: new JsonObjectMapper(
        typeMappers: [
            User::class => fn(array $data) => new User(
                name: $data['name'],
                lastName: $data['surname'],
            ),
        ],
    ),
);
```

Please refer to the core mapper documentation for additional configuration options.

---

📦 Related Packages
------------------

[](#-related-packages)

- Core mapper:
- Symfony integration:
- Laravel integration:

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance78

Regular maintenance activity

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

2

Last Release

117d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c8ac1821d71c0ddddcc3494a165dc40cfa3e759a467d8a00956ceeae4b833bb3?d=identicon)[thiagocordeiro](/maintainers/thiagocordeiro)

---

Top Contributors

[![thiagocordeiro](https://avatars.githubusercontent.com/u/1073649?v=4)](https://github.com/thiagocordeiro "thiagocordeiro (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tcds-io-php-jackson-guzzle/health.svg)

```
[![Health](https://phpackages.com/badges/tcds-io-php-jackson-guzzle/health.svg)](https://phpackages.com/packages/tcds-io-php-jackson-guzzle)
```

###  Alternatives

[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[omniphx/forrest

A Laravel library for Salesforce

2724.4M8](/packages/omniphx-forrest)[akamai-open/edgegrid-client

Implements the Akamai {OPEN} EdgeGrid Authentication specified by https://developer.akamai.com/introduction/Client\_Auth.html

482.5M6](/packages/akamai-open-edgegrid-client)[muhammadhuzaifa/telescope-guzzle-watcher

Telescope Guzzle Watcher provide a custom watcher for intercepting http requests made via guzzlehttp/guzzle php library. The package uses the on\_stats request option for extracting the request/response data. The watcher intercept and log the request into the Laravel Telescope HTTP Client Watcher.

98239.8k1](/packages/muhammadhuzaifa-telescope-guzzle-watcher)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[ory/hydra-client-php

Documentation for all of Ory Hydra's APIs.

1710.8k](/packages/ory-hydra-client-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
