Overview of JsonMapper
masterJsonMapper is a PHP library designed to map nested JSON structures onto your own PHP model classes. It converts JSON data into nested objects and arrays by hydrating class properties based on your existing class definitions.
Key features include:
- No Schema Required: It does not rely on JSON schemas; it uses your PHP class definitions instead.
- Automatic Type Detection: It determines property types by parsing:
- PHP type declarations
@vardocblock annotations- Type hints in setter methods
- Zero Modification: You do not need to add JSON-specific code to your model classes; it works by parsing existing docblocks.
- No Dependencies: The library is standalone.
This process is similar to the native SOAP parameter mapping provided by PHP's SoapClient, but optimized for JSON.