aipng/json-serializer

json serializer (jms serializer + custom data handlers)

v3.0.4 2024-12-10 13:39 UTC

This package is auto-updated.

Last update: 2024-12-10 13:41:42 UTC


README

Build Status

JSON Serializer

How to install

composer require aipng/json-serializer

Usage

Could be used standalone or as Nette extension.

Nette extension

config.neon

extensions:
	serializer: AipNg\JsonSerializer\DI\JsonSerializerExtension

serializer:
	temporaryDirectory: %tempDir%/cache
	productionMode: true # optional
	validator: # optional
	serializationHandlers: # optional

Parameters

temporaryDirectory

Use writable path

productionMode

For debugging purposes, true by default

validator

  • class, that implements AipNg\JsonSerializer\Validator
  • AipNg\JsonSerializer\Validator\NullValidator is used by default

It could be combined with symfony/validator with provided adapter. With contributte/validator use this configuration:

extensions:
	serializer: AipNg\JsonSerializer\DI\JsonSerializerExtension
	validator: Contributte\Validator\DI\ValidatorExtension

serializer:
	temporaryDirectory: %tempDir%/cache
	validator: AipNg\JsonSerializer\Validator\SymfonyValidator

serializationHandlers

Specific serialization handlers for JMS serializer. More id JMS documentation.