# Decoding Multi Level Json

**URL:** <https://forum.elixirforum.com/t/decoding-multi-level-json/32925>\
**Category:** Questions\
**Tags:** json, jason, elixir-httpoison, multi-level-json, decode\
**Created:** [July 8, 2020, 5:56pm UTC](https://forum.elixirforum.com/t/decoding-multi-level-json/32925 "2020-07-08T17:56:25Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![tushar](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/t/5fc32e/32.png) [@tushar](https://forum.elixirforum.com/u/tushar)\
**Post date:** [July 9, 2020, 6:51am UTC](https://forum.elixirforum.com/t/decoding-multi-level-json/32925/7 "2020-07-09T06:51:21Z")

</div>

`"{\"topic\": \"dummy_topic\", \"msg\": \"{\"fruit\":\"apple\",\"dish\":\"apple-pie\"}\"}"` → This does not work

```elixir
iex(1)> Jason.decode("{\"topic\": \"dummy_topic\", \"msg\": \"{\"fruit\":\"apple\",\"dish\":\"apple-pie\"}\"}")
{:error,
 %Jason.DecodeError{
   data: "{\"topic\": \"dummy_topic\", \"msg\": \"{\"fruit\":\"apple\",\"dish\":\"apple-pie\"}\"}",
   position: 35,
   token: nil
 }}

```

`"{\"topic\": \"dummy_topic\", \"msg\": {\"fruit\":\"apple\",\"dish\":\"apple-pie\"}}"` → This works

```elixir
iex(2)> Jason.decode("{\"topic\": \"dummy_topic\", \"msg\": {\"fruit\":\"apple\",\"dish\":\"apple-pie\"}}")
{:ok,
 %{
   "msg" => %{"dish" => "apple-pie", "fruit" => "apple"},
   "topic" => "dummy_topic"
 }}

```

The only difference between the strings is

`"{\"topic\": \"dummy_topic\", \"msg\": *\"*{\"fruit\":\"apple\",\"dish\":\"apple-pie\"}*\"*}"`

The escape sequences causing problem are wrapped in \*

Those two escape sequences if removed , makes it work fine.

Is there a way with Sigils I can choose to not have those escapes ? or I have to do string manipulation to have it working ?

---

_[View the full topic](https://forum.elixirforum.com/t/decoding-multi-level-json/32925)._
