Lab Apply subset pattern : confusing error message

First, i would like to apologize since i have no choice but to discuss a lab solution :pray:
I’m at this lab. I’ve edited the problem_schema.json according to the instruction available, and after validating, i received a rather confusing error message :

  • Is the top_five_reviews is required or not? If it is, then why it is not allowed?
  • is the top_five_questions is required or not?

In short : why is something that is required is not allowed? :sweat_smile:

My current solution is as follows :

Solution

{
“_id”: “objectId”,
“item_code”: “string”,
“name”: “string”,
“maker_brand”: “string”,
“price”: “decimal”,
“description”: “string”,
“materials”: [“string”],
“country”: “string”,
“image”: “string”,
“available_sizes”: {
“mens”: [“string”],
“womens”: [“string”]
},
“package_weight_kg”: “decimal”,
“average_rating”: “decimal”,
“stock_amount”: “int”,
"top_five_reviews ": [{
“author”: “string”,
“text”: “string”,
“rating”: “int”
}],
"top_five_questions ": [{
“author”: “string”,
“text”: “string”,
“likes”: “int”
}]
}

Hi @Rickard_Peter,

Is it the full solution? I can’t see data type on the right side of the fields :slight_smile:

Otherwise, the schema looks good to me.

Kanika

1 Like

Hi, i just realized that in the comment editor, if i enclosed anything with less than (<) and greater than (>) symbols, any characters in between will be invinsible. I have edited my original comment, i hope you can see the data type now.

Hi again, sorry about this topic, this hapenned because there is something wrong with my laptop. I have passed this assignment by using another PC. Thank you for editing my spoiler answer :pray:

1 Like