swsnu / swppfall2021

Learning Software Engineering By Building Web Services
28 stars 19 forks source link

Questions about HW4 #133

Open jaeyeonkim99 opened 2 years ago

jaeyeonkim99 commented 2 years ago

Before submitting, I want to check for some details.

  1. Do we have to handle error for signup? For example for the case their is already the user with the username exists.
  2. For the cases where the HTTP status codes are not explicitly mentioned(the GET methods), what status code should we return? Is it okay to return 200?
  3. For handling non-existing articles and comments, if the GET request is send to /api/article/:article_id/comment/ , with artice_id that doesn't exist, should we return 404 or 200 with empty list?
  4. Exact JSON response format for some methods are missed. Can I assume as following? POST /api/article: id, title, content, author(id) PUT /api/article/:article_id: id, title, content, author(id) POST /api/article/:aritlce_id/comment /:id, article(id), content, author(id) PUT /api/comment/:comment_id/ :id, article(id), content, author(id)
  5. Can we assume that CSRF tokens are appropriately set, for example as we set manually using POSTMAN, while grading the code so that no 403 error will happen?

Thank you.

ttoru96 commented 2 years ago
  1. You'll be fine as long as your implementation covers everything on Readme. I'm afraid that I cannot tell you more than that.

  2. Yes, please return 200 for such cases.

  3. Regarding requests to non-existing resources, the API server should return 404 status code. You'll be able to find more detailed explanation at Q2 of FAQ.

  4. Please refer to my answer at https://github.com/swsnu/swppfall2021/issues/130#issue-1043422920

  5. I'm very sorry that I cannot tell you much about test code. However, I can assure you that you'll be fine as long as your implementation covers everything on Readme.

jaeyeonkim99 commented 2 years ago

Thank you!