Restaurant objects in the json file

" restaurants ": [ {“id”: 1, “name”: “Fire”, “type”: "EUROPEAN ", " openingTickStart ": 1, " openingTickEnd ": 24, “recipes”: [1,2,3], " kitchenStaff ": {"TOURNANT ": 1}, " waitstaff ": 1, " deliveryDrivers ":3, “tables”: [ { “id”: 2, “type”: “COMMON”, “size”: 9 }, { “id”: 3, “type”: “COMMON”, “size”: 2 }, { “id”: 4, “type”: “COMMON”, “size”: 3 }, { “id”: 5, “type”: “COMMON”, “size”: 3 }, { “id”: 6, “type”: “COMMON”, “size”: 8 }]}, " positiveRatings ": 10, " negativeRatings ": 5 ]

I’m not that an expert with JSON files and serializable, but shouldn’t the “}” that I marked after the list of table objects ends be behind the ratings, so that these ratings could be associated to this restaurant? Because as far as I understand JSON files, within these Braces {} we define the concrete object with all its properties, and the ratings should belong to a particular restaurant. In addition, would this kind of structure even work, “restaurants” defines a list of restaurant object via [], where each element of the list is defined via {}, and therefore the ratings would fall out of this pattern.

Yes, it’s a typo. The marked } closes the restaurant object too early. positiveRatings and negativeRatings belong inside that object, after tables.

2 Likes