swsnu / swppfall2019

31 stars 23 forks source link

[HW3] Response content에 대해 #142

Open ybzzang opened 4 years ago

ybzzang commented 4 years ago

이미 스펙에 명시된 내용이지만 확실하게 여쭤보고 싶어 글 남깁니다.

GET api/article:

Response with a JSON having a list of dictionaries for each article's title, content, and author. The value of the author must be the id of the author but not her username.

POST api/article:

Create an article with the information given by request JSON body and response with 201. Posted article (with it's assigned id) should be included in response's content as JSON format.

모델의 필드들 말고 id까지 json에 함께 넘어오는 POST/PUT의 response와는 달리 GET 시 받는 Json은 id 없이 title, content, author(_id) 이 세 필드만의 dict 인가요?

ktaebum commented 4 years ago

네 맞습니다! 저 부분이 혼란이 될 수 있을 것 같아서 GET을 할 때 id가 추가로 넘어온다고 감점을 하거나 하지는 않겠습니다