1

I'm trying to get the JSON response of SonataUserBundle Api. So after following the config process from the Sonata HomePage docs

It looks like this API returns an empty object

enter image description here

sonataUserBundle api Users

gam6itko
  • 15,128
  • 2
  • 19
  • 18
Houssem Cherif
  • 221
  • 1
  • 11

2 Answers2

1

It looks like you forgot to add metadata directory to jms_serializer config.

jms_serializer:
    metadata:
        directories:            
            SonataDatagridBundle:
                namespace_prefix: 'Sonata\DatagridBundle\'
                path: '@SonataDatagridBundle/Resources/config/serializer'

            # Also don't forget to add NewsBundle metadata too
            ApplicationSonataNewsBundle:
                namespace_prefix: 'Application\Sonata\NewsBundle\'
                path: '@ApplicationSonataNewsBundle/Resources/config/serializer'
gam6itko
  • 15,128
  • 2
  • 19
  • 18
0

user class have private members duw to which it can not be accessed. either you need you change it specifier or you can iterate it and store in an array and than you can pass it

M Maavia
  • 340
  • 1
  • 9