serializer icon indicating copy to clipboard operation
serializer copied to clipboard

Add option to set naming strategy per object

Open tarjei opened this issue 4 years ago • 0 comments

Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? no

Steps required to reproduce the problem

Given a class like

class Product {
  public $onlyForDevs;
}
  1. Add @NamingStrategy("camelCase") to the class
  2. Serialize.
  3. Get:
{
"onlyForDevs": 1
}

Expected Result

{
"onlyForDevs": 1
}

Actual Result

{
"only_for_devs": 1
}

The point here is to be able to do a partial conversion to camelCase without having to change 1000s of attributes or do a big bang conversion of the complete API.

tarjei avatar May 07 '20 10:05 tarjei