{"action":"created","issue":{"url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/686","repository_url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle","labels_url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/686/labels{/name}","comments_url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/686/comments","events_url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/686/events","html_url":"https://github.com/schmittjoh/JMSSerializerBundle/issues/686","id":365262050,"node_id":"MDU6SXNzdWUzNjUyNjIwNTA=","number":686,"title":"Filelocator is not called in Symfony 4","user":{"login":"mehdi-zarrin","id":1389003,"node_id":"MDQ6VXNlcjEzODkwMDM=","avatar_url":"https://avatars3.githubusercontent.com/u/1389003?v=4","gravatar_id":"","url":"https://api.github.com/users/mehdi-zarrin","html_url":"https://github.com/mehdi-zarrin","followers_url":"https://api.github.com/users/mehdi-zarrin/followers","following_url":"https://api.github.com/users/mehdi-zarrin/following{/other_user}","gists_url":"https://api.github.com/users/mehdi-zarrin/gists{/gist_id}","starred_url":"https://api.github.com/users/mehdi-zarrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mehdi-zarrin/subscriptions","organizations_url":"https://api.github.com/users/mehdi-zarrin/orgs","repos_url":"https://api.github.com/users/mehdi-zarrin/repos","events_url":"https://api.github.com/users/mehdi-zarrin/events{/privacy}","received_events_url":"https://api.github.com/users/mehdi-zarrin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-09-30T21:12:17Z","updated_at":"2018-10-01T08:55:29Z","closed_at":"2018-09-30T21:22:58Z","author_association":"NONE","body":"Hi, \r\nI'm using Symfony 4 + FOSUserBundle for security reasons I have to hide some fields (email, password,..). For some reason, the metadata file locator is not called after I call the serialize method in a controller. Here is my configuration: \r\n\r\npackages/jms_serializer.yaml\r\n```\r\njms_serializer:\r\n    visitors:\r\n        xml:\r\n            format_output: '%kernel.debug%'\r\n    metadata:\r\n        auto_detection: true\r\n        directories:\r\n            FOSUB:\r\n                namespace_prefix: FOS\\UserBundle\r\n                path: \"%kernel.root_dir%/serializer\"\r\n```\r\nsrc/serializer/FOSUB/Model.User.yml\r\n```\r\nFOS\\UserBundle\\Model\\User:\r\n    exclusion_policy: ALL\r\n    properties:\r\n        firstName:\r\n            expose: true\r\n```\r\n\r\ncomposer\r\n```\r\njms/metadata                           1.6.0              \r\njms/parser-lib                           1.0.0              \r\njms/serializer                            1.13.0             \r\njms/serializer-bundle               2.4.2\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/comments/425835037","html_url":"https://github.com/schmittjoh/JMSSerializerBundle/issues/686#issuecomment-425835037","issue_url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/686","id":425835037,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTgzNTAzNw==","user":{"login":"mehdi-zarrin","id":1389003,"node_id":"MDQ6VXNlcjEzODkwMDM=","avatar_url":"https://avatars3.githubusercontent.com/u/1389003?v=4","gravatar_id":"","url":"https://api.github.com/users/mehdi-zarrin","html_url":"https://github.com/mehdi-zarrin","followers_url":"https://api.github.com/users/mehdi-zarrin/followers","following_url":"https://api.github.com/users/mehdi-zarrin/following{/other_user}","gists_url":"https://api.github.com/users/mehdi-zarrin/gists{/gist_id}","starred_url":"https://api.github.com/users/mehdi-zarrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mehdi-zarrin/subscriptions","organizations_url":"https://api.github.com/users/mehdi-zarrin/orgs","repos_url":"https://api.github.com/users/mehdi-zarrin/repos","events_url":"https://api.github.com/users/mehdi-zarrin/events{/privacy}","received_events_url":"https://api.github.com/users/mehdi-zarrin/received_events","type":"User","site_admin":false},"created_at":"2018-10-01T08:55:29Z","updated_at":"2018-10-01T08:55:29Z","author_association":"NONE","body":"I noticed that the issue was related to wrong way of calling the serializer:\r\ninstead of\r\n`$serializer = $this->get('jms_serializer');`\r\n\r\nI was doing :\r\n```\r\n$serializerBuilder = SerializerBuilder::create();\r\n$serializerBuilder->setPropertyNamingStrategy(new \\JMS\\Serializer\\Naming\\IdenticalPropertyNamingStrategy());\r\n$serializer = $serializerBuilder->build();\r\n```\r\nnow it's fixed. "}}
{"actor":{"display_login":"mehdi-zarrin"}}