2017 © Pedro Peláez
 

library jms-serializer-strict-json

Provide strict JSON deserialization

image

justblackbird/jms-serializer-strict-json

Provide strict JSON deserialization

  • Tuesday, April 25, 2017
  • by justblackbird
  • Repository
  • 1 Watchers
  • 0 Stars
  • 105 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 35 % Grown

The README.md

JMS Serializer Strict JSON Build Status

Deserialize JSON using strict types validation, (*1)

Installation

Run in the command line:, (*2)

composer require justblackbird/jms-serializer-strict-json

Usage

Use the StrictJsonDeserializationVisitor from the package instead of JMSSerializer built in JsonDeserializationVisitor., (*3)

For example, if you use the following code to instantiate JMS serializer:, (*4)

use JMS\Serializer\SerializerBuilder;

$serializer = SerializerBuilder::create()->build();

You should change it to something like:, (*5)

use JMS\Serializer\Naming\CamelCaseNamingStrategy;
use JMS\Serializer\Naming\SerializedNameAnnotationStrategy;
use JMS\Serializer\SerializerBuilder;
use JustBlackBird\JmsSerializerStrictJson\StrictJsonDeserializationVisitor;

$naming_strategy = new SerializedNameAnnotationStrategy(new CamelCaseNamingStrategy());
$serializer = SerializerBuilder::create()
    ->setPropertyNamingStrategy($naming_strategy)
    ->setDeserializationVisitor('json', new StrictJsonDeserializationVisitor($naming_strategy))
    ->build();

Then use the serializer as you used to., (*6)

License

Apache 2.0 (c) Dmitriy Simushev, (*7)

The Versions

25/04 2017

dev-master

9999999-dev https://github.com/JustBlackBird/jms-serializer-strict-json

Provide strict JSON deserialization

  Sources   Download

Apache2

The Requires

 

The Development Requires

by Dmitriy Simushev

json serializer jms

25/04 2017

0.2.0

0.2.0.0 https://github.com/JustBlackBird/jms-serializer-strict-json

Provide strict JSON deserialization

  Sources   Download

Apache2

The Requires

 

The Development Requires

by Dmitriy Simushev

json serializer jms

25/04 2017

0.1.0

0.1.0.0 https://github.com/JustBlackBird/jms-serializer-strict-json

Provide strict JSON deserialization

  Sources   Download

Apache2

The Requires

 

The Development Requires

by Dmitriy Simushev

json serializer jms