You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see on the SeoData class, I want to @Exclude() the $file_image property, because it cause an error: Serialization of 'Symfony\Component\HttpFoundation\File\File' is not allowed and this error is happening when I try to upload a file and saving the SeoConfig data.
So, I want to avoid the above error and that's why I try to @Exclude it.
But it seems it's not working on the embedded object like the sample above.
If I don't upload a file, and just save the rest data, it's working.
Expected Result
The $file_image property should be excluded from serializing process and it doesn't throw the Serialization of 'Symfony\Component\HttpFoundation\File\File' is not allowed error
Actual Result
Even though I have put the @Exclude() annotation on the above $file_image property, it still throws the error.
The text was updated successfully, but these errors were encountered:
Could you provide some simple repository that reproduce your issue or stack trace for the error? I've tried it, but exclusion works for me with your example. The error that you provided seems to be connected with call to serialize function over Symfony\Component\HttpFoundation\File\File, but not JSON / XML serialisation.
Steps required to reproduce the problem
I have an entity class called
SeoConfig
that has a field called$seo_data
which is an object of theSeoData
class.Here is the code
As you can see on the
SeoData
class, I want to@Exclude()
the$file_image
property, because it cause an error:Serialization of 'Symfony\Component\HttpFoundation\File\File' is not allowed
and this error is happening when I try to upload a file and saving theSeoConfig
data.Here is my
jms_serializer.yml
file:So, I want to avoid the above error and that's why I try to
@Exclude
it.But it seems it's not working on the embedded object like the sample above.
If I don't upload a file, and just save the rest data, it's working.
Expected Result
$file_image
property should be excluded from serializing process and it doesn't throw theSerialization of 'Symfony\Component\HttpFoundation\File\File' is not allowed
errorActual Result
@Exclude()
annotation on the above$file_image
property, it still throws the error.The text was updated successfully, but these errors were encountered: