You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[
{
"name": "Foyer",
"x": 0,
"y": 0,
"width": 3,
"height": 3,
"color": "lightgray",
"description": "Ein großes, einladendes Foyer mit Marmorboden, hohen Decken und einem majestätischen Kronleuchter. An den Wänden hängen alte Gemälde der Familie Blackwood.",
"image": "foyer.jpg"
},
{
"name": "Bibliothek",
"x": 3,
"y": 0,
"width": 3,
"height": 3,
"color": "lightblue",
"description": "Eine ruhige Bibliothek mit hohen Bücherregalen, vollgestopft mit alten Büchern. In der Mitte steht ein massiver Eichentisch, auf dem noch geöffnete Bücher und ein Glas Whiskey stehen.",
"image": "bibliothek.jpg"
}
]
There I get the message " Failed to load asset 'cases/Mord im Herrenhaus/data/rooms.json' with asset loader 'bevy_common_assets::json::JsonAssetLoader<rust_bevy_murder_mystery_game::Rooms>': Could not parse the JSON: invalid type: map, expected a sequence at line 2 column 4
"
Whats wrong?
Best regards Gerhard
The text was updated successfully, but these errors were encountered:
What should the above struct serialize to as json? I'd say roughly the following:
{"rooms": [// the 'Room' objects here.]}
I am not certain about this, but I assume serde is fine with not specifying the Rooms object as a literal JSON object, because it only has one field. So it allows for swapping the outermost object with an array, like this:
[[// the 'Room' objects here.]]
Try putting the #[serde(transparent)] attribute on the Rooms struct. I think this could fix your issue.
Hello,
I try to load this JSON file:
Part of my program:
There I get the message " Failed to load asset 'cases/Mord im Herrenhaus/data/rooms.json' with asset loader 'bevy_common_assets::json::JsonAssetLoader<rust_bevy_murder_mystery_game::Rooms>': Could not parse the JSON: invalid type: map, expected a sequence at line 2 column 4
"
Whats wrong?
Best regards Gerhard
The text was updated successfully, but these errors were encountered: