PHPackages                             polesphp/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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. polesphp/json

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

polesphp/json
=============

Type-safe, class-oriented JSON (de)serialization library.

0.1.0(7y ago)06Apache-2.0PHPPHP &gt;=7.2.0

Since Jun 26Pushed 7y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (2)Used By (0)

poles-json
==========

[](#poles-json)

`poles-json` is a type-safe, class-oriented JSON (de)serialization library.

Goals
-----

[](#goals)

- Clean, simple API
- Strict on errors (always throw exceptions)
- Strict type-checking by default
- Encourage clean code by defining pure PHP data structures that describe input.

Non-goals
---------

[](#non-goals)

- Bridging for any PHP web framework
- Mapping JSON properties to getter and setter methods. I don't do the Java Bean thing.
- Value validation. This library will check that your value is a string, but will never validate that this string has a minimum of `n` characters or that it matches a certain regular expression. If you need such validation logic, this library combines nicely with [Symfony's Validation component](https://symfony.com/doc/current/validation.html).

Usage
-----

[](#usage)

First, define a pure PHP data structure which represents your JSON schema:

```
