FOSRestBundle
FOSRestBundle copied to clipboard
how to hidden user sensitive field?
i use fosuserbundle and fosrestbundle
but rest api return a user password,salt field
look like:
{"comments": "id": 1, "body": "xxx", "user": {"id": 1, "password": "xxxx", "salt": "xxx", "email": "xxx", .....}}
i need hidden password,salt field, how to do?
thinks.
You need to tell the serializer to exclude those fields. Check http://williamdurand.fr/2012/08/02/rest-apis-with-symfony2-the-right-way/ for an example. (and it's a good read anyway in general ;) )
Yes, please configure the serializer layer.
ok, thx.