PHPackages                             slimphp-api/slim-json - 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. slimphp-api/slim-json

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

slimphp-api/slim-json
=====================

A module for slim, JSON middleware for encoding based on Content-Type

5601PHP

Since Nov 21Pushed 10y ago1 watchersCompare

[ Source](https://github.com/slimphp-api/slim-json)[ Packagist](https://packagist.org/packages/slimphp-api/slim-json)[ RSS](/packages/slimphp-api-slim-json/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

slim-json
=========

[](#slim-json)

[![Coverage Status](https://camo.githubusercontent.com/1e41616ea5d95a6952c6a618bdc9dc772aff332cdeaaf9c23f4aa23415481773/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f736c696d7068702d6170692f736c696d2d6a736f6e2f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/slimphp-api/slim-json?branch=master)[![Code Climate](https://camo.githubusercontent.com/73338d02bd858c14ce3bc40028914800adbe697554188475b21171e8b7635770/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f736c696d7068702d6170692f736c696d2d6a736f6e2f6261646765732f6770612e737667)](https://codeclimate.com/github/slimphp-api/slim-json)[![Build Status](https://camo.githubusercontent.com/06c225fdbca67f001aa7a30a496e48c79d8e1fbcb70f11123117c50c037ea634/68747470733a2f2f7472617669732d63692e6f72672f736c696d7068702d6170692f736c696d2d6a736f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/slimphp-api/slim-json)

JSON middleware that enforces a json response wherever possible. Based on Accept header

installation
============

[](#installation)

`composer require slimphp-api/slim-json`

usage
=====

[](#usage)

Add middleware in the usual way. For slim:

```
use Slim\App;
$app = new App();
$app->add(new SlimApi\Json\Json);
$app->run();

```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8eead2f413dc6c16192320a2529534ed3f145c4f523fcadcc6af85c6be578f2c?d=identicon)[gabriel403](/maintainers/gabriel403)

---

Top Contributors

[![gabriel403](https://avatars.githubusercontent.com/u/118638?v=4)](https://github.com/gabriel403 "gabriel403 (5 commits)")

### Embed Badge

![Health badge](/badges/slimphp-api-slim-json/health.svg)

```
[![Health](https://phpackages.com/badges/slimphp-api-slim-json/health.svg)](https://phpackages.com/packages/slimphp-api-slim-json)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M90](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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