Added and updated the /resume/skill endpoint for PUT requests to accept a JSON and index to edit existing skills. On success, the new skill is returned in JSON format, and both data in memory and data.json on disk are updated.
Issue
This request closes issue #6.
Testing
An example PUT 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_edit() in test_pytest.py calls this endpoint with index 0 and a new skill. It then validates its success by comparing it with a GET request at the same index.
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. Furthermore, a valid input JSON is one that simply includes all attributes found in the Skill class, so other dictionary entries are valid, but ignored.
Summary
Added and updated the
/resume/skill
endpoint for PUT requests to accept a JSON and index to edit existing skills. On success, the new skill is returned in JSON format, and bothdata
in memory anddata.json
on disk are updated.Issue
This request closes issue #6.
Testing
An example PUT 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_edit()
intest_pytest.py
calls this endpoint with index 0 and a new skill. It then validates its success by comparing it with a GET request at the same index.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. Furthermore, a valid input JSON is one that simply includes all attributes found in theSkill
class, so other dictionary entries are valid, but ignored.