New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON Serialization Options seem to be ignored #763
Comments
hmm. weird. can you check which params are received by the https://github.com/schmittjoh/serializer/blob/master/src/Visitor/Factory/JsonSerializationVisitorFactory.php ? |
I can see that However, https://github.com/schmittjoh/JMSSerializerBundle/blob/master/DependencyInjection/JMSSerializerExtension.php#L199 - This line does get executed and it gets correct parameter. |
I see that you are using willdurand/hateoas (but you did not mention its bundle), are you using the hateoas builder or the provided bundle integration? (99% the problem lies there :) ) |
Yes, willdurand/hateoas-bundle v2.0.1. I will check if it builds own instance of JMS serializer, ignoring the options. |
Correct, Hateoas was actually the cause. Thank you for your time, and my apologies for a false alarm! |
Symfony: v4.3.2
willdurand/hateoas: v3.1.0
jms/serializer: v3.1.1
jms/serializer-bundle: v3.4.1
I may be missing something, however I've noticed that I'm getting escaped slashes in my serialized output, even though my config looks as follows:
I've tried setting
options:
in other ways too:If I deliberately mistype a key, I get an error, so it shows that they are being read. However, the output is not being changed. Slashes are escaped and pretty print is not being performed.
If I dump
$options
in JsonSerializationVisitor.php, I can see that only the defaultJSON_PRESERVE_ZERO_FRACTION
flag is being used. I have tried to find where are Options from the config being used, however, I was unsuccessful.The text was updated successfully, but these errors were encountered: