# Escaping Json String

**URL:** <https://forum.ansible.com/t/escaping-json-string/21249>\
**Category:** Ansible Project\
**Created:** [April 24, 2016, 1:07pm UTC](https://forum.ansible.com/t/escaping-json-string/21249 "2016-04-24T13:07:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben2](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@ben2](https://forum.ansible.com/u/ben2)\
**Post date:** [April 24, 2016, 1:07pm UTC](https://forum.ansible.com/t/escaping-json-string/21249/1 "2016-04-24T13:07:08Z")

</div>

In version 2.0.2.0 (in version 2.0.0.2 it works fine)

In a local action I’m generating the following json object

[https://gist.github.com/thebenwaters/7795d1cdead9280e0c5abcbc23b9ca59](https://gist.github.com/thebenwaters/7795d1cdead9280e0c5abcbc23b9ca59)

Then registering it to standard out it looks like so:

[https://gist.github.com/thebenwaters/5299d3d9986985697ae87a30a33890ec](https://gist.github.com/thebenwaters/5299d3d9986985697ae87a30a33890ec)

but it needs to looklike

[https://gist.github.com/thebenwaters/991d0263e47972fd7f2209560033fab0](https://gist.github.com/thebenwaters/991d0263e47972fd7f2209560033fab0)

Why did it change from the last version and is there a way to fix it?

One possible solution I had was to use the  
`

> quote  
> `

filter, but it ends up with illegal single quotes at the beginning

[https://gist.github.com/thebenwaters/899928514f26eb96986048787c3a5af0](https://gist.github.com/thebenwaters/899928514f26eb96986048787c3a5af0)
