- Home /
KeyNotFound Json error
Hey Im new to Json and i got a KeyNotFound Error if I try to get the json string. It works with other jsonfiles, so I guess the code is fine. This is the not working Json File:
{
"enchantments":
[
{
"normal":
[
{
"id":"1",
"name":"Test Enchatment",
"description":"Just a test enchatment"
},
{
"id":"2",
"name":"Test Enchatment2",
"description":"Just a test enchatment2"
}
],
"rare":
[
{
"id":"1",
"name":"Rare Enchatment",
"description":"Just a test enchatment"
},
{
"id":"2",
"name":"Rare Enchatment2",
"description":"Just a test enchatment2"
}
],
"epic":
[
{
"id":"1",
"name":"Test Enchatment",
"description":"Just a test enchatment"
},
{
"id":"2",
"name":"Test Enchatment2",
"description":"Just a test enchatment2"
}
],
"legendary":
[
{
"id":"1",
"name":"legendary Enchatment",
"description":"Just a test enchatment"
},
{
"id":"2",
"name":"Test Enchatment2",
"description":"Just a test enchatment2"
}
]
]
}
Answer by sath · May 17, 2020 at 10:47 AM
fixed version
{
"enchantments": [
{
"normal": [
{
"id": "1",
"name": "Test Enchatment",
"description": "Just a test enchatment"
},
{
"id": "2",
"name": "Test Enchatment2",
"description": "Just a test enchatment2"
}
],
"rare": [
{
"id": "1",
"name": "Rare Enchatment",
"description": "Just a test enchatment"
},
{
"id": "2",
"name": "Rare Enchatment2",
"description": "Just a test enchatment2"
}
],
"epic": [
{
"id": "1",
"name": "Test Enchatment",
"description": "Just a test enchatment"
},
{
"id": "2",
"name": "Test Enchatment2",
"description": "Just a test enchatment2"
}
],
"legendary": [
{
"id": "1",
"name": "legendary Enchatment",
"description": "Just a test enchatment"
},
{
"id": "2",
"name": "Test Enchatment2",
"description": "Just a test enchatment2"
}
]
}
]
}
what did I make wrong? just the brackets at the wrong position?
The third line from the bottom was missing a closing brace...
There are some good online tools to help find these errors - one of my favorites is https://jsoneditoronline.org/
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Saving JSON file in Android,How to save json file in android 0 Answers
Illuminating a 3D object's edges OnMouseOver (script in c#)? 1 Answer
How can I figure if an Object was created at runtime? (for extending Json save/load) 0 Answers