canvasapi icon indicating copy to clipboard operation
canvasapi copied to clipboard

Investigate Incorrect/Removed Account Endpoints

Open Thetwam opened this issue 6 years ago • 0 comments

#179 Added a script to check docstrings. It resulted in many good fixes, but there are still a few outstanding issues:

canvasapi/canvas.py create_account docstring refers to method.accounts.create in https://canvas.instructure.com/doc/api/accounts.html, not found

canvasapi/account.py create_account docstring refers to method.accounts.create in https://canvas.instructure.com/doc/api/accounts.html, not found

The above methods (Account.create_account and Canvas.create_account) refer to endpoints that no longer appear in the documentation. Determine if the endpoints are still valid. If they are, find a way to have the validation script ignore these two cases. If they are not, consider removal.

canvasapi/account.py close_notification_for_user docstring DELETE /api/v1/accounts/:account_id/users/:user_id/account_notifications/:id not found in https://canvas.instructure.com/doc/api/account_notifications.html#method.account_notifications.user_close_notification (found ['DELETE /api/v1/accounts/:account_id/account_notifications/:id'])

canvasapi/account.py get_user_notifications docstring GET /api/v1/accounts/:account_id/users/:user_id/account_notifications not found in https://canvas.instructure.com/doc/api/account_notifications.html#method.account_notifications.user_index (found ['GET /api/v1/accounts/:account_id/account_notifications'])

The above methods (Account.close_notification_for_user and Account.get_user_notifications) seem to have changed to no longer take in a user. It looks like it now applies the changes only to the current user. Determine if this is indeed the case and adjust the method as necessary.

Once the above methods are fixed, add the docstring validation script to the Travis build as a required step. This will help prevent future docstring issues from cropping up.

Action Items

  • [ ] Check and fix Account.create_account
  • [ ] Check and fix Canvas.create_account
  • [ ] Check and fix Account.close_notification_for_user
  • [ ] Check and fix Account.get_user_notifications
  • [ ] Add docstring validation script to Travis build

Thetwam avatar Jun 01 '18 15:06 Thetwam