- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 309
Closed
Description
Hello there!
I recently posted a problem for the restbundle (FriendsOfSymfony/FOSRestBundle#438).
Long story short I dont want my special chars to be "escaped" or anything else.
Like for example the string:
{"wikipedia":"en.wikipedia.org/wiki/Mexico_City"}
would be in my situation:
{"wikipedia":"en.wikipedia.org/wiki/Mexico_City"}
I know that this is perfectly valid, but the output should stay like the first string.
Can anyone help?
Activity
stof commentedon Apr 18, 2013
use PHP 5.4+ and the JSON_UNESCAPED_SLASHES flag for json_encode
stof commentedon Apr 18, 2013
note that it will be configured this way:
stof commentedon Apr 18, 2013
Well, you probably also want
JSON_UNESCAPED_UNICODE
so it would bepriestor commentedon Apr 18, 2013
Oh dude! Thats sweet, I was hoping there is a thing like that.
Thank you very mucho!
Case Closed :) 👍
stof commentedon Apr 18, 2013
you should push the "close" button then (I cannot do it as I'm not the maintainer of the bundle and not the creator of the issue)
diegocavalletti commentedon May 8, 2017
@stof #289 (comment) What if this doesn't work? I setted it up in my config.yml but that doesn't seem to change the output which is still quote-escaped
sstrgar commentedon Jun 27, 2017
I can confirm that. Same Here. Some more information about my setup:
goetas commentedon Jun 27, 2017
sstrgar commentedon Jun 27, 2017
Sure. It's the same as described before. Location: config.yml
goetas commentedon Jul 9, 2017
hmm, i tried and it works... are you sure is not an encoding issue? can you create a failing test case?
buffcode commentedon Mar 6, 2018
Is there any possibility to set this on a per-use basis? I could not find a way to set this on the
SerializationContext
, as the setting gets mapped to a global parameter (jms_serializer.json_serialization_visitor.options
) which is then injected into theJsonSerializationVisitor
.webarchitect609 commentedon Jan 28, 2019
@buffcode , @alexandr-lakeev , there is, but it's dirty one. Look:
Output: