PHP Classes

File: doc/

Recommend this page to a friend!
  Classes of Julian Finkler   JSON Object Mapper   doc/   Download  
File: doc/
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: JSON Object Mapper
Create objects of classes mapped from JSON strings
Author: By
Last change:
Date: 5 years ago
Size: 546 bytes


Class file image Download

Multiple Annotations

? Go to index

In some edge-cases a property name in the json can vary:

    {"first name": "Foo"},
    {"first*name": "Bar"},
    {"first-name": "Baz"},
    {"first_name": "FooBarBaz"}

In this case you can add multiple @JsonField annotations for a property.

class CrappySourceData {
     * @JsonField(name="first name") 
     * @JsonField(name="first-name") 
     * @JsonField(name="first_name") 
    public $firstName;