nus-cs2103-AY2324S2 / pe-dev-response

0 stars 0 forks source link

Duplicate field in JSON File #2613

Open nus-se-script opened 2 months ago

nus-se-script commented 2 months ago

Overview By adding an additional duplicate field into the JSON data file, the program does not clear its contents as described in the UG for when the data file format is invalid, If your changes to the data file make its format invalid, FitBook will discard all data and start with an empty data file at the next run

Steps to reproduce

Expected behaviour

Actual behaviour

Potential solution Note this discrepancy into the user guide / developer guide planned enhancements. You could also replace the JSON parsing library that the project uses, as it does not currently check for duplicates.

Screenshots

image.png

Screenshot 2024-04-19 at 4.16.27 PM.png


[original: nus-cs2103-AY2324S2/pe-interim#2161] [original labels: type.FunctionalityBug severity.Medium]

dillontkh commented 2 months ago

Team's Response

image.png

According to RFC 8259, the JSON format allows duplicate names within an object. (more information can be found in this stackoverflow thread)

Thus, the data format is not invalid and the address book not clearing is intended.

Additionally, the UG also specifies the following:

image.png

Thus, we have decided to reject this bug.

Duplicate status (if any):

--