PHPackages                             hershel-theodore-layton/json-post-deserialize - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. hershel-theodore-layton/json-post-deserialize

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

hershel-theodore-layton/json-post-deserialize
=============================================

A fast to run verification to run after json\_decode()

v0.2.1(8mo ago)0227MITHackCI passing

Since Oct 11Pushed 1w agoCompare

[ Source](https://github.com/hershel-theodore-layton/json-post-deserialize)[ Packagist](https://packagist.org/packages/hershel-theodore-layton/json-post-deserialize)[ RSS](/packages/hershel-theodore-layton-json-post-deserialize/feed)WikiDiscussions master Synced today

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

JSON Post Deserialize
=====================

[](#json-post-deserialize)

*A fast to run verification to run after json\_decode()*

Why?
----

[](#why)

`\json_decode()` can parse invalid JSON. If you want to store the JSON and expect to be able to parse it in the future, you should check it is not invalid JSON first. Future versions of hhvm might not parse invalid JSON the same way. Other programming environments, like Python, Go, or JavaScript certainly don't.

How?
----

[](#how)

After calling `\json_decode_with_error()`, you should check the `$error` variable. If this is `null`, you might still have parsed invalid JSON. `\HTL\JsonCheck\quick_reject(string $json)`will let you know that this happened. `quick_reject()` does not return an error for many invalid JSON documents, but it does return an error for every invalid JSON document that gets past `\json_decode_with_error()`.

Why do this in Hack?
--------------------

[](#why-do-this-in-hack)

There is no function accessible to Hack that can validate a JSON document. If you want to call a real JSON parser, you'd need to call an external process. The overhead of copying the json string to the external process outweighs the cost of the hot loop in `quick_reject()`.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance82

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 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 ~22 days

Total

2

Last Release

243d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d16d159b7061287c506d4ab44d05ae042bc4ec697116d1bd132a007634d9ff21?d=identicon)[Hershel Theodore Layton](/maintainers/Hershel%20Theodore%20Layton)

---

Top Contributors

[![hershel-theodore-layton](https://avatars.githubusercontent.com/u/81193606?v=4)](https://github.com/hershel-theodore-layton "hershel-theodore-layton (24 commits)")

### Embed Badge

![Health badge](/badges/hershel-theodore-layton-json-post-deserialize/health.svg)

```
[![Health](https://phpackages.com/badges/hershel-theodore-layton-json-post-deserialize/health.svg)](https://phpackages.com/packages/hershel-theodore-layton-json-post-deserialize)
```

###  Alternatives

[marcosh/php-validation-dsl

A DSL for validating data in a functional fashion

483.9k](/packages/marcosh-php-validation-dsl)

PHPackages © 2026

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