vitek-dev / nette-json-serializer
JSON-preconfigured symfony/serializer integration into Nette
v1.1.0
2025-08-05 09:34 UTC
Requires
- nette/di: ^3.2
- phpdocumentor/reflection-docblock: ^5.6
- psr/http-message: ^2.0
- symfony/property-access: ^7.3
- symfony/serializer: ^7.3
Requires (Dev)
- nette/bootstrap: ^3.2
- phpunit/phpunit: ^12.3
README
Preconfigured symfony/serializer for Nette Framework.
Features
- Serialize and deserialize PHP objects to/from JSON
- Handles nested objects and arrays (via PHPDoc annotations)
- Enums support
- Discriminators
- Syntax sugar for Guzzle: Ability to directly deserialize MessageInterface/StreamInterface
Requirements
- PHP 8.4 or higher
Installation
composer require vitek-dev/nette-json-serializer
extensions: vd.serializer: VitekDev\Serializer\DI\JsonSerializerExtension
Known issues
Class with no properties
Deserialization of class with no properties will end up with NotNormalizableValueException
class Garage { /** * @param Car[] $cars */ public function __construct( public array $cars, ) {} } class Car { // No properties }