{"openapi":"3.0.0","info":{"description":"This is a 42StackOverflow","version":"1.0.0","title":"42StackOverFlow","termsOfService":"https://swim.42seoul.io","contact":{"email":"hainho9704@gmail.com"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"servers":[{"url":"http://localhost:5000/api"}],"tags":[{"name":"page","description":"페이지"},{"name":"hashtag","description":"hashtag"},{"name":"post","description":"게시글"},{"name":"question","description":"질문 게시글"},{"name":"answer","description":"답변 게시글"},{"name":"comment","description":"댓글"},{"name":"user","description":"유저"},{"name":"like","description":"좋아요"},{"name":"auth","description":"인증"}],"components":{"schemas":{"User":{"properties":{"id":{"type":"integer"},"created_at":{"type":"string"},"email":{"type":"string"},"nickname":{"type":"string"},"photo":{"type":"string"}},"required":["id","nickname","email"]},"MainPage":{"properties":{"questionList":{"type":"array","items":{"type":"object","properties":{"question":{"$ref":"#/components/schemas/Question"}}}},"questionCount":{"type":"integer"}}},"QuestionPage":{"properties":{"questionInfo":{"$ref":"#/components/schemas/QuestionInfo"},"answerInfos":{"type":"array","items":{"type":"object","properties":{"answer":{"$ref":"#/components/schemas/AnswerInfo"},"user":{"$ref":"#/components/schemas/User"},"comments":{"type":"array","items":{"type":"object","properties":{"comment":{"$ref":"#/components/schemas/Comment"},"user":{"$ref":"#/components/schemas/User"}}}}}}}}},"Question":{"properties":{"id":{"type":"integer"},"created_at":{"type":"string"},"is_solved":{"type":"boolean"},"answer_count":{"type":"integer"},"like_count":{"type":"integer"},"view_count":{"type":"integer"},"title":{"type":"string"},"text":{"type":"string"},"user":{"$ref":"#/components/schemas/User"},"hashtag":{"type":"array","items":{"$ref":"#/components/schemas/Hashtag"}}},"required":["id","title","text","viewCount","likeCount","isSolved"]},"QuestionInfo":{"properties":{"id":{"type":"integer"},"created_at":{"type":"string"},"user":{"$ref":"#/components/schemas/User"},"answer":{"$ref":"#/components/schemas/AnswerInfo"},"comment":{"$ref":"#/components/schemas/Comment"},"hashtag":{"type":"array","items":{"$ref":"#/components/schemas/Hashtag"}},"is_solved":{"type":"boolean"},"like_count":{"type":"integer"},"view_count":{"type":"integer"},"title":{"type":"string"},"text":{"type":"string"},"is_like":{"type":"boolean"}},"required":["id","title","text","viewCount","likeCount","isSolved"]},"AnswerInfo":{"properties":{"id":{"type":"integer"},"created_at":{"type":"string"},"user":{"$ref":"#/components/schemas/User"},"comment":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}},"likeCount":{"type":"integer"},"text":{"type":"string"},"isChosen":{"type":"boolean"},"isLike":{"type":"boolean"}},"required":["id","text","likeCount","isChosen"]},"Answer":{"properties":{"id":{"type":"integer","format":"int64"},"text":{"type":"string"}},"required":["text"]},"Comment":{"properties":{"id":{"type":"integer","format":"int64"},"created_at":{"type":"string"},"text":{"type":"string"},"user":{"$ref":"#/components/schemas/User"}},"required":["id","text"]},"Image":{"properties":{"id":{"type":"integer"},"photo":{"type":"string"}},"required":["id","photo"]},"Hashtag":{"properties":{"id":{"type":"integer"},"name":{"type":"string"}},"required":["id","name"]}},"requestBodies":{"Comment":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comment"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Comment"}}},"description":"comment","required":true},"Answer":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Answer"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Answer"}}},"description":"comment","required":true},"Question":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Question"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Question"}}},"description":"comment","required":true}}},"paths":{"/hashtags/list":{"get":{"summary":"해시태그들을 반환합니다.","tags":["hashtag"],"responses":{"200":{"description":"해시태그 리스트 요청 성공"},"404":{"description":"Hashtag doesn't exist"}}}},"/hashtags/questions":{"get":{"summary":"해시태그에 속한 질문글들을 반환합니다.","tags":["hashtag"],"parameters":[{"name":"hashtag","in":"query","schema":{"type":"string"},"example":"ft_printf","required":true},{"name":"pageNumber","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true}],"responses":{"200":{"description":"해시태그 질문 리스트 요청 성공"},"404":{"description":"Hashtag doesn't exist"}}}},"/hashtags/count":{"get":{"summary":"해시테그 별 질문 갯수","tags":["hashtag"],"parameters":[{"name":"pageNumber","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true}],"responses":{"200":{"description":"페이지 요청 성공"},"404":{"description":"Page doesn't exist"}}}},"/posts/image":{"post":{"summary":"사진을 업로드합니다.","tags":["post"],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"imgFile":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"OK"},"404":{"description":"fail"}}}},"/posts/question":{"get":{"summary":"질문 게시글을 반환합니다.","tags":["question"],"parameters":[{"name":"body","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true}],"responses":{"200":{"description":"질문 게시글 요청 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Question"}}}},"404":{"description":"Question doesn't exist"}}},"post":{"summary":"질문 게시글을 생성합니다.","tags":["question"],"requestBody":{"content":{"application/json":{"schema":{"properties":{"title":{"type":"string","example":"test question title"},"text":{"type":"string","example":"test question text"},"hashtag":{"type":"array","items":{"type":"string"},"example":["ft_printf","libft"]}},"required":["title","text"]}}}},"responses":{"200":{"description":"OK"},"404":{"description":"Question doesn't exist"}}},"patch":{"summary":"질문 게시글을 업데이트합니다.","tags":["question"],"requestBody":{"content":{"application/json":{"schema":{"properties":{"questionId":{"type":"integer","format":"int64","example":1},"title":{"type":"string","example":"update test question title"},"text":{"type":"string","example":"update test question text"},"hashtag":{"type":"array","items":{"type":"string"},"example":["gnl","b2br"]}},"required":["questionId","title","text"]}}}},"responses":{"200":{"description":"OK"},"404":{"description":"Question doesn't exist"}}},"delete":{"summary":"질문 게시글을 삭제합니다.","tags":["question"],"parameters":[{"name":"questionId","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true}],"responses":{"200":{"description":"OK"},"404":{"description":"Question doesn't exist"}}}},"/posts/answer":{"get":{"summary":"답변 게시글을 반환합니다.","tags":["answer"],"parameters":[{"name":"answerId","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true}],"responses":{"200":{"description":"답변 게시글 요청 성공"},"404":{"description":"Answer doesn't exist"}}},"post":{"summary":"답변 게시글을 생성합니다.","tags":["answer"],"requestBody":{"content":{"application/json":{"schema":{"properties":{"questionId":{"type":"integer","format":"int64","example":1},"text":{"type":"string","example":"test answer text"}},"required":["questionId","text"]}}}},"responses":{"200":{"description":"OK"},"404":{"description":"Answer doesn't exist"}}},"patch":{"summary":"답변 게시글을 업데이트합니다.","tags":["answer"],"requestBody":{"content":{"application/json":{"schema":{"properties":{"questionId":{"type":"integer","format":"int64","example":1},"answerId":{"type":"integer","format":"int64","example":1},"text":{"type":"string","example":"update test answer text"}},"required":["questionId","answerId","text"]}}}},"responses":{"200":{"description":"OK"},"404":{"description":"Answer doesn't exist"}}},"delete":{"summary":"답변 게시글을 삭제합니다.","tags":["answer"],"parameters":[{"name":"questionId","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true},{"name":"answerId","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true}],"responses":{"200":{"description":"OK"},"404":{"description":"Answer doesn't exist"}}}},"/posts/answer/choice":{"post":{"summary":"답변 게시글을 채택합니다.","tags":["answer"],"requestBody":{"content":{"application/json":{"schema":{"properties":{"questionId":{"type":"integer","format":"int64","example":1},"answerId":{"type":"integer","format":"int64","example":1},"answerUserId":{"type":"integer","format":"int64","example":1}},"required":["questionId","answerId","answerUserId"]}}}},"responses":{"200":{"description":"OK"},"404":{"description":"Answer doesn't exist"}}}},"/posts/comment":{"get":{"summary":"댓글을 반환합니다.","tags":["comment"],"parameters":[{"name":"commentId","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true}],"responses":{"200":{"description":"댓글 요청 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comment"}}}},"404":{"description":"Comment doesn't exist"}}},"post":{"summary":"댓글을 생성합니다.","tags":["comment"],"description":"question comment 작성시 requestBody에 answerId 제외하고 사용","requestBody":{"content":{"application/json":{"schema":{"properties":{"text":{"type":"string","example":"test question comment text"},"questionId":{"type":"integer","format":"int64","example":1},"answerId":{"type":"integer","format":"int64","example":1}},"required":["text"]}}}},"responses":{"200":{"description":"OK"},"400":{"description":"Invalid Id supplied"},"404":{"description":"Comment doesn't exist"}}},"patch":{"summary":"댓글을 업데이트합니다.","tags":["comment"],"description":"question comment 작성시 requestBody에 answerId 제외하고 사용","requestBody":{"content":{"application/json":{"schema":{"properties":{"text":{"type":"string","example":"test update question comment text"},"commentId":{"type":"integer","format":"int64","example":1},"questionId":{"type":"integer","format":"int64","example":1},"answerId":{"type":"integer","format":"int64","example":1}},"required":["commnetId","text"]}}}},"responses":{"200":{"description":"OK"},"400":{"description":"Invalid Id supplied"},"404":{"description":"Comment doesn't exist"}}},"delete":{"summary":"댓글을 삭제합니다.","tags":["comment"],"parameters":[{"name":"questionId","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true},{"name":"answerId","in":"query","schema":{"type":"integer","format":"int64"},"example":1},{"name":"commentId","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid Id supplied"},"404":{"description":"Comment doesn't exist"}}}},"/pages/list/question":{"get":{"summary":"메인 페이지를 반환합니다.","tags":["page"],"parameters":[{"name":"pageNumber","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true}],"responses":{"200":{"description":"페이지 요청 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MainPage"}}}},"404":{"description":"Page doesn't exist"}}}},"/pages/list/question/hashtag/id":{"get":{"summary":"해시태그 아이디로 질문글 리스트를 반환합니다.","tags":["page"],"description":"데이터를 최신순으로 정렬하려면 orderBy = \"time\", 좋아요 순으로 정렬하려면 \"like\", 해결되지 않은 질문 리스트를 응답 받으려면 \"solving\" 사용","parameters":[{"name":"pageNumber","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true},{"name":"hashtagId","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true},{"name":"orderBy","in":"query","schema":{"type":"string"},"example":"time","required":true}],"responses":{"200":{"description":"페이지 요청 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MainPage"}}}},"404":{"description":"Page doesn't exist"}}}},"/pages/list/question/hashtag/name":{"get":{"summary":"해시태그 이름으로 질문글 리스트를 반환합니다.","tags":["page"],"description":"데이터를 최신순으로 정렬하려면 orderBy = \"time\", 좋아요 순으로 정렬하려면 \"like\", 해결되지 않은 질문 리스트를 응답 받으려면 \"solving\" 사용","parameters":[{"name":"pageNumber","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true},{"name":"hashtagName","in":"query","schema":{"type":"string"},"example":"ft_printf","required":true},{"name":"orderBy","in":"query","schema":{"type":"string"},"example":"time","required":true}],"responses":{"200":{"description":"페이지 요청 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MainPage"}}}},"404":{"description":"Page doesn't exist"}}}},"/pages/list/question/userId":{"get":{"summary":"유저 아이디로 질문글 리스트를 반환합니다.","tags":["page"],"description":"데이터를 최신순으로 정렬하려면 orderBy = \"time\", 좋아요 순으로 정렬하려면 \"like\", 해결되지 않은 질문 리스트를 응답 받으려면 \"solving\" 사용","parameters":[{"name":"pageNumber","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true},{"name":"userId","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true},{"name":"orderBy","in":"query","schema":{"type":"string"},"example":"time","required":true}],"responses":{"200":{"description":"페이지 요청 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MainPage"}}}},"404":{"description":"Page doesn't exist"}}}},"/pages/list/answer/userId":{"get":{"summary":"유저 아이디로 답변글 리스트를 반환합니다.","tags":["page"],"description":"데이터를 최신순으로 정렬하려면 orderBy = \"time\", 좋아요 순으로 정렬하려면 \"like\", 채택된 답변 리스트를 응답 받으려면 \"chosen\" 사용","parameters":[{"name":"pageNumber","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true},{"name":"userId","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true},{"name":"orderBy","in":"query","schema":{"type":"string"},"example":"time","required":true}],"responses":{"200":{"description":"페이지 요청 성공"},"404":{"description":"Page doesn't exist"}}}},"/pages/list/comment/userId":{"get":{"summary":"유저 아이디로 댓글 리스트를 반환합니다.","tags":["page"],"description":"댓글은 최신순으로 정렬하여 응답합니다.","parameters":[{"name":"pageNumber","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true},{"name":"userId","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true}],"responses":{"200":{"description":"페이지 요청 성공"},"404":{"description":"Page doesn't exist"}}}},"/pages/list/question/like":{"get":{"summary":"질문 리스트를 추천순으로 반환합니다.","tags":["page"],"parameters":[{"name":"pageNumber","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true}],"responses":{"200":{"description":"페이지 요청 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MainPage"}}}},"404":{"description":"Page doesn't exist"}}}},"/pages/list/question/keyword":{"get":{"summary":"질문 리스트를 검색하여 반환합니다.","tags":["page"],"description":"검색한 데이터를 최신순으로 정렬하려면 orderBy = \"time\", 좋아요 순으로 정렬하려면 \"like\", 해결되지 않은 질문 리스트를 응답 받으려면 \"solving\" 사용","parameters":[{"name":"pageNumber","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true},{"name":"keyword","in":"query","schema":{"type":"string"},"example":"question","required":true},{"name":"orderBy","in":"query","schema":{"type":"string"},"example":"time","required":true}],"responses":{"200":{"description":"페이지 요청 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MainPage"}}}},"404":{"description":"Page doesn't exist"}}}},"/pages/list/question/unsolved":{"get":{"summary":"해결되지 않은 질문 리스트를 반환합니다.","tags":["page"],"parameters":[{"name":"pageNumber","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true}],"responses":{"200":{"description":"페이지 요청 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MainPage"}}}},"404":{"description":"Page doesn't exist"}}}},"/pages/detail/question":{"get":{"summary":"질문 페이지를 반환합니다.","tags":["page"],"parameters":[{"name":"questionId","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true}],"responses":{"200":{"description":"페이지 요청 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuestionPage"}}}},"404":{"description":"Page doesn't exist"}}}},"/pages/question/viewCount":{"post":{"summary":"질문글의 조회수를 증가시킵니다.","tags":["page"],"requestBody":{"content":{"application/json":{"schema":{"properties":{"questionId":{"type":"integer","format":"int64"}},"required":["questionId"],"example":{"questionId":1}}}}},"responses":{"200":{"description":"OK"},"404":{"description":"Question doesn't exist"}}}},"/posts/answer/like":{"post":{"summary":"좋아요를 생성합니다.","tags":["like"],"description":"answerUserId 는 answer 작성자의 id로 작성자가 받은 좋아요 수를 업데이트 시켜주는 데 사용함","requestBody":{"content":{"application/json":{"schema":{"properties":{"answerUserId":{"type":"integer","format":"int64"},"answerId":{"type":"integer","format":"int64"},"isLike":{"type":"boolean"}},"required":["answerUserId","answerId","isLike"],"example":{"answerUserId":1,"answerId":1,"isLike":true}}}}},"responses":{"200":{"description":"OK"},"404":{"description":"Answer doesn't exist"}}},"delete":{"summary":"좋아요를 삭제합니다.","tags":["like"],"description":"answerUserId 는 answer 작성자의 id로 작성자가 받은 좋아요 수를 업데이트 시켜주는 데 사용함","parameters":[{"name":"answerId","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true},{"name":"answerUserId","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true},{"name":"isLike","in":"query","schema":{"type":"boolean"},"example":true,"required":true}],"responses":{"200":{"description":"OK"},"404":{"description":"Answer doesn't exist"}}}},"/posts/question/like":{"post":{"summary":"좋아요를 생성합니다.","tags":["like"],"description":"questionUserId 는 question 작성자의 id로 작성자가 받은 좋아요 수를 업데이트 시켜주는 데 사용함","requestBody":{"content":{"application/json":{"schema":{"properties":{"questionUserId":{"type":"integer","format":"int64"},"questionId":{"type":"integer","format":"int64"},"isLike":{"type":"boolean"}},"example":{"questionUserId":1,"questionId":1,"isLike":true},"required":["questionUserId","questionId","isLike"]}}}},"responses":{"200":{"description":"OK"},"404":{"description":"Question doesn't exist"}}},"delete":{"summary":"좋아요를 삭제합니다.","tags":["like"],"description":"questionUserId 는 question 작성자의 id로 작성자가 받은 좋아요 수를 업데이트 시켜주는 데 사용함","parameters":[{"name":"questionId","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true},{"name":"questionUserId","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true},{"name":"isLike","in":"query","schema":{"type":"boolean"},"example":true,"required":true}],"responses":{"200":{"description":"OK"},"404":{"description":"Question doesn't exist"}}}},"/auth/login":{"post":{"summary":"로그인합니다.","tags":["auth"],"requestBody":{"content":{"application/json":{"schema":{"properties":{"email":{"type":"string"},"password":{"type":"string"}},"required":["email","password"],"example":{"email":"tester1@gmail.com","password":"tester1"}}}}},"responses":{"200":{"description":"OK"},"404":{"description":"email doesn't exist"}}}},"/auth/signup":{"post":{"summary":"회원가입 합니다.","tags":["auth"],"requestBody":{"content":{"application/json":{"schema":{"properties":{"email":{"type":"string"},"nickname":{"type":"string"},"password":{"type":"string"}},"required":["email","nickname","password"],"example":{"email":"tester@gmail.com","nickname":"tester","password":"test"}}}}},"responses":{"200":{"description":"OK"},"404":{"description":"email already exist"}}}},"/auth/42login":{"get":{"summary":"42로그인합니다.","tags":["auth"],"responses":{"200":{"description":"OK"},"404":{"description":"email doesn't exist"}}}},"/users/info":{"get":{"summary":"유저 정보를 반환합니다.","tags":["user"],"responses":{"200":{"description":"유저 정보 요청 성공"},"404":{"description":"User doesn't exist"}}}},"/users/profile":{"get":{"summary":"다른 유저 프로필을 조회합니다.","tags":["user"],"parameters":[{"name":"userId","in":"query","schema":{"type":"integer","format":"int64"},"example":1,"required":true}],"responses":{"200":{"description":"유저 프로필 요청 성공"},"404":{"description":"User doesn't exist"}}}},"/users/ranking":{"get":{"summary":"랭킹 정보를 가져옵니다.","tags":["user"],"responses":{"200":{"description":"랭킹 요청 성공"}}}},"/users/image":{"patch":{"summary":"프로필 사진을 업데이트합니다.","tags":["user"],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"imgFile":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"OK"},"404":{"description":"User doesn't exist"}}},"delete":{"summary":"프로필 사진을 삭제합니다.","tags":["user"],"responses":{"200":{"description":"OK"},"404":{"description":"User doesn't exist"}}}},"/users/nickname":{"patch":{"summary":"닉네임을 업데이트합니다.","tags":["user"],"requestBody":{"content":{"application/json":{"schema":{"properties":{"nickname":{"type":"string"}},"example":{"nickname":"newTester1"},"required":["nickname"]}}}},"responses":{"200":{"description":"OK"},"404":{"description":"User doesn't exist"}}}},"/users/password":{"patch":{"summary":"비밀번호를 업데이트합니다.","tags":["user"],"requestBody":{"content":{"application/json":{"schema":{"properties":{"curPassword":{"type":"string"},"newPassword":{"type":"string"}},"example":{"curPassword":"tester1","newPassword":"newTester1"},"required":["curPassword","newPassword"]}}}},"responses":{"200":{"description":"OK"},"404":{"description":"User doesn't exist"}}}},"/users/email":{"patch":{"summary":"이메일을 업데이트합니다.","tags":["user"],"requestBody":{"content":{"application/json":{"schema":{"properties":{"email":{"type":"string"}},"example":{"email":"newTester1@gmail.com"},"required":["email"]}}}},"responses":{"200":{"description":"OK"},"404":{"description":"User doesn't exist"}}}}}}