# JSON to string transposing problem

**URL:** <https://discourse.julialang.org/t/json-to-string-transposing-problem/108967>\
**Category:** Data\
**Tags:** question, json\
**Created:** [January 18, 2024, 3:02pm UTC](https://discourse.julialang.org/t/json-to-string-transposing-problem/108967 "2024-01-18T15:02:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 18, 2024, 3:32pm UTC](https://discourse.julialang.org/t/json-to-string-transposing-problem/108967/2 "2024-01-18T15:32:58Z")

</div>

The input to `JSON.parse` should be a string. You aren’t passing a string, you are trying to input JavaScript syntax `{"type": "led-ring", …` directly into Julia, which won’t work. That is, you are confusing JSON _data_ with Julia _code_.

Try e.g.

```julia
LED = JSON.parse("""
{
  "type": "led-ring", 
  "payload": {"mode": 1, "duration": 10000, 
              "speed": 100, "brightness": 255, 
              "colors": ["0xFFFFFF", "0xFFFFFF", "0xFFFFFF"]}
}
""")

```

to wrap your JSON input in a Julia string. (I’ve added some line breaks for readability.)

PS. Please read [PSA: how to quote code with backticks](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530)

---

_[View the full topic](https://discourse.julialang.org/t/json-to-string-transposing-problem/108967)._
