Open nus-pe-bot opened 6 months ago
Thanks for raising this. This is a very rare occurrence.
https://github.com/nus-cs2103-AY2324S2/forum/issues/917
Based on the issues, we have indicated that editing the JSON file does not guarantee whether it will work as intended.
--
Description
As sseen in the screenshot, if the Json file is modified to have multiple fields with "name", there is no error thrown, even though this is invalid state, and the last field with "name" is taken instead. This might cause some issues as the person might want the earlier name to be used instead, but this errs silently. This should be raised to the user, or can be listed in the UG.
Screenshots
Steps to reproduce
Expected vs Actual Behaviour
The application boots up as normal, and the last instance of the "name" field is used, and the first "name" is dropped. This should return as an error instead, and let the user know that the JSON file is invalid state.
Suggestion
This seems to be a flaw within the JSON parsing part, as it silently ignores that there are two fields w the same name. In this part of ur UG, perhaps u can. mention that not only does the name need to be unique across persons, but it also needs to be only one field with "name"' inside the person object.
[original: nus-cs2103-AY2324S2/pe-interim#1750] [original labels: type.FunctionalityBug severity.Medium]