Modifying schemas

There are certain things in the spec that the schemas do not consistently enforce (for example, minimum amount of restaurants is enforced, minimum of recipes isn’t).

Are we allowed to modify the given schemas to add additional requirements that the spec already mentions?

2 Likes

Hi you cannot modify schemas

3 Likes

Okay, but I would argue this is a bug in the schema, because it enforces minimum array lengths everywhere else. Can it be fixed from your side?

If not, is the minimum amount of recipes per restaurant something we should validate outside of the schema? Because everywhere else, the schema enforces minimum array lengths.

1 Like

I agree with you on it is better enforcing minimum array length of recipes, I need to confirm later whether it is possible to change the schema.
But for now just follow the current schema, it is not a bug just a case that it can not cover, if the recipes is an empty list, and when we are parsing a restaurant and are sure that the basic dish for that restaurant type is not existed so we can safely say the restaurant.json is invalid.

4 Likes

Hi, we discussed this internally and decided that we will not adjust the schema.

One of the validation rules you have to implement states:

Per restaurant there must exist at least one recipe, waiter, table and cook.

If the overall list of recipes is empty, this rule can never be fulfilled, so the restaurant parsing phase will always reject the configuration file. Hence, there are no later edge cases caused by this oversight in the schema.

Note that, since we didn’t spot this mistake before, we don’t expect you to test this particular case, and none of the tests running against your implementation will cover it.

6 Likes