PHPackages                             geosocio/http-serializer - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. geosocio/http-serializer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

geosocio/http-serializer
========================

Serializes a Controller Request &amp; Response

5.2.0(8y ago)256311LGPL-3.0-onlyPHP

Since Jul 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/geosocio/http-serializer)[ Packagist](https://packagist.org/packages/geosocio/http-serializer)[ RSS](/packages/geosocio-http-serializer/feed)WikiDiscussions develop Synced 3w ago

READMEChangelog (2)Dependencies (8)Versions (18)Used By (1)

Http Serializer [![Build Status](https://camo.githubusercontent.com/4309047a7784720a1a0c5f00148e3691ecdf21caa893bf05c5513c1ee9e6a5c5/68747470733a2f2f7472617669732d63692e6f72672f67656f736f63696f2f687474702d73657269616c697a65722e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/geosocio/http-serializer) [![Coverage Status](https://camo.githubusercontent.com/aa9d24d3858dda616ee2924b5d5558a085c0a3eb628b50bedf9b58c9a6f27cb8/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f67656f736f63696f2f687474702d73657269616c697a65722f62616467652e737667)](https://coveralls.io/github/geosocio/http-serializer)
==================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#http-serializer--)

Serializes a Controller Request &amp; Response.

### Request

[](#request)

`POST` &amp; `PUT` requests may have their contents deserialized into an object. Any request with a content body (e.g. `PATCH`) may have the contents decoded into an array.

### Response

[](#response)

A controller's response will serialized into the same format of the request. If you need more advanced handling, you may always return a `Response`object without interference.

### Groups

[](#groups)

Groups may be applied to the request or the response (or both) with the groups annotation.

- Request Groups `GeoSocio\HttpSerializer\Annotation\RequestGroups`
- Response Groups `GeoSocio\HttpSerializer\Annotation\ResponseGroups`
- Request &amp; Response Groups `Symfony\Component\Serializer\Annotation\Groups`

They may also be applied with a `GroupResolver`.

Example
-------

[](#example)

```
/**
 * @Route("/post/{post}")
 * @Method({"GET"})
 *
 * @Groups({"show"})
 */
public function showAction(Post $post) {
    return $post;
}

/**
 * @Route("/post")
 * @Method({"POST"})
 *
 * @RequestGroups({"create"})
 * @ResponseGroups({"show"})
 */
public function createAction(Post $post) {
    $em = $this->doctrine->getEntityManager();
    $em->persist($post);
    $em->flush();
    return $post;
}

/**
 * @Route("/post/{post}")
 * @Method({"PUT"})
 *
 * @RequestGroups({"replace"})
 * @ResponseGroups({"show"})
 */
public function replaceAction(Post $post, Post $content) {
    $em = $this->doctrine->getEntityManager();
    $em->merge($content);
    $em->flush();
    return $post;
}

/**
 * @Route("/post/{post}")
 * @Method({"PATCH"})
 *
 * @RequestGroups({"update"})
 * @ResponseGroups({"show"})
 */
public function updateAction(Post $post, array $content) {
    $em = $this->doctrine->getEntityManager();
    $post = $this->serializer->denormalizer($content, $post);
    $em->flush();
    return $post;
}

/**
 * @Route("/post/{post}")
 * @Method({"DELETE"})
 */
public function deleteAction(Post $post) {
    $em = $this->doctrine->getEntityManager();
    $em->remove($post);
    $em->flush();
    return '';
}
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 98.8% 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 ~15 days

Recently: every ~42 days

Total

17

Last Release

3019d ago

Major Versions

1.2.1 → 3.0.02017-07-25

3.0.0 → 4.0.02017-07-25

4.0.3 → 5.0.02017-09-30

### Community

Maintainers

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

---

Top Contributors

[![davidbarratt](https://avatars.githubusercontent.com/u/868364?v=4)](https://github.com/davidbarratt "davidbarratt (81 commits)")[![kruglikdenis](https://avatars.githubusercontent.com/u/9932991?v=4)](https://github.com/kruglikdenis "kruglikdenis (1 commits)")

---

Tags

phpsymfonysymfony-serializer

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/geosocio-http-serializer/health.svg)

```
[![Health](https://phpackages.com/badges/geosocio-http-serializer/health.svg)](https://phpackages.com/packages/geosocio-http-serializer)
```

###  Alternatives

[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k50.1M314](/packages/api-platform-core)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M373](/packages/easycorp-easyadmin-bundle)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19564.8M1.6k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9317.2k55](/packages/open-dxp-opendxp)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6941.5M396](/packages/drupal-core-recommended)

PHPackages © 2026

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