HttpService:JSONDecode() not parsing JSON but returning the raw JSON string that was passed into the function

I am having a problem that just came out of nowhere, HttpsService:JSONDecode is not parsing the passed raw JSON string I passed.

Here is my code:

local chars = playerData:FindFirstChild(plr.Name).Characters -- Fetch stringValue containing raw json of some of the Player's data
local parsedData = http:JSONDecode(chars.Value) -- try parse the json

What was returned:

local returned = "{\"chars\":[\"Rare Brick\",\"Uncommon Brick\"]}" -- Not a lua table

What is expected:

local returned = {
    chars = {
       "Rare Brick",
       "Uncommon Brick"
    }
}

I do not know why this is happening and if you need any more information please reply and i’ll give you the information.

Can you provide the raw input please. It might be the entire thing is enclosed in quotemarks and is therefore a string according to JSON schema.

So basically show us what print(chars.Value) outputs.

1 Like

output
String

absolute
Absolute value

I fixed the problem by scrapping the JSON storage idea all together and instead made my own string data saving method that has strings that have split points so I could load it as an array and make it a string to save.

Thanks to everyone who tried to help