Answer the question
In order to leave comments, you need to log in
How to stop fos_rest from converting camelCase keys to underscore?
There is an object with fields:
firstKey: 'first value'
secondKey: 'second value'
thirdKey: 'third value'
{"first_key": 'first value',
"second_key": 'second value',
"third_key": 'third value' }
Answer the question
In order to leave comments, you need to log in
Well, firstly, this is not a problem of fos_rest, but of a serializer. By default jms is used in fos_rest.
In Google for the request "jms_serializer naming_strategy" you will find this link https://github.com/schmittjoh/JMSSerializerBundle/...
Following which you will find the following piece of config
property_naming:
id: ~
strategy: camel_case|identical
camel_case:
separator: _
lower_case: true|false
enable_annotation: true|false
enable_cache: true|false
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question