FriendsOfSymfony / FOSRestBundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony
http://symfony.com/doc/master/bundles/FOSRestBundle/index.html
MIT License
2.79k stars 704 forks source link

Custom array keys are being replaced with indexes starting at 0 #2300

Closed smadaman closed 3 years ago

smadaman commented 3 years ago

Hi. Since updating to the latest version I now have an issue where custom keys that I have set as strings are just being replaced with indexes.

This is my data in Postman prior to the update image

And this is my data in Postman after the update image

I have not changed any code at all. I am organising the returning list as:

Is this something that has changed in FOSRestBundle or I guess it could be in another library that this one relies on?

Thanks in advance!

xabbuh commented 3 years ago

Without knowing more about your application my guess would be that this is related to the serializer library that you use when generating the response.

smadaman commented 3 years ago

No worries, thanks. I'm using the JMS serializer. I might look into that.

Update: JMS Serializer was the problem. They updated it yesterday with a fix. Thanks again