casionaut has quit [Remote host closed the connection]
ur5us has joined #crystal-lang
<frojnd>
I am using sqlitedb and one filed is json field. But when I pull that from db and and I do data.class it says "String" So crystal thinks it's a String. (json string) ?
<frojnd>
Anyways what's the best way to serialize this string that is json string?
<frojnd>
Well actually parsing it
<frojnd>
JSON.parse(json_string)
ur5us has quit [Ping timeout: 264 seconds]
taupiqueur has joined #crystal-lang
<frojnd>
Hm
<frojnd>
How should I debug this. I have json_string and when running JSON.parse(json_string) I get: Error: no overload matches 'JSON.parse' with type (Float64 | Int64 | Slice(UInt8) | String | Nil)
<frojnd>
json_string looks like this: `{"blog_title":"1. januar 2018","title":"null","verse_id":""}`
<frojnd>
Ok I see why
<frojnd>
Because my json_string must be wrapped inside double quotes like this: `json_data = JSON.parse("#{json_string}")`
<frojnd>
And now when I json_data.class I get JSON::Any
taupiqueur_ has joined #crystal-lang
taupiqueur has quit [Read error: Connection reset by peer]