Added and updated the /resume/skill endpoint for DELETE requests to remove existing skills. On success, the erased skill is returned in JSON format, and both data in memory and data.json on disk are updated.
Issue
This request closes issue #3.
Testing
An example DELETE request for /resume/skill?index=value will succeed if a valid JSON is provided and value is numeric and within bounds. The provided test case test_skill_delete() in test_pytest.py calls this endpoint with index 0. It then validates the removal by calling a GET request at the same index, ensuring an error or a different skill is returned.
Concerns
This implementation does not use the serialization class we discussed earlier as the issue has not yet been resolved. Similarly, index is obtained via query (not URL) parameters, which is another concern our team has discussed. Lastly, there can be mismatches between the id attribute and the actual index of a given skill; deleting a skill will decrement the indices of all skills in front, but not their ids. As such, the id of different skills can be identical under certain conditions, and may generally lead to problems.
Summary
Added and updated the
/resume/skill
endpoint for DELETE requests to remove existing skills. On success, the erased skill is returned in JSON format, and bothdata
in memory anddata.json
on disk are updated.Issue
This request closes issue #3.
Testing
An example DELETE request for
/resume/skill?index=value
will succeed if a valid JSON is provided andvalue
is numeric and within bounds. The provided test casetest_skill_delete()
intest_pytest.py
calls this endpoint with index 0. It then validates the removal by calling a GET request at the same index, ensuring an error or a different skill is returned.Concerns
This implementation does not use the serialization class we discussed earlier as the issue has not yet been resolved. Similarly,
index
is obtained via query (not URL) parameters, which is another concern our team has discussed. Lastly, there can be mismatches between theid
attribute and the actual index of a given skill; deleting a skill will decrement the indices of all skills in front, but not their ids. As such, theid
of different skills can be identical under certain conditions, and may generally lead to problems.