serializer
serializer copied to clipboard
Add option to set naming strategy per object
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;
}
- Add @NamingStrategy("camelCase") to the class
- Serialize.
- 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.