Skip to content

Commit

Permalink
Modify swagger docs (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeonghaeJo authored Sep 13, 2024
1 parent 92593e6 commit 5b600a0
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 37 deletions.
8 changes: 4 additions & 4 deletions api/src/main/kotlin/router/docs/AdminDocs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.springframework.web.bind.annotation.RequestMethod
operationId = "insertNotification",
description = "어드민 권한으로 알림 보내기",
requestBody = RequestBody(
content = [Content(schema = Schema(implementation = InsertNotificationRequest::class))],
content = [Content(schema = Schema(implementation = InsertNotificationRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)],
required = true,
description = "userId null이면 모든 유저에게 보냄"
),
Expand All @@ -39,7 +39,7 @@ import org.springframework.web.bind.annotation.RequestMethod
path = "/v1/admin/configs/{name}", method = [RequestMethod.POST], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "postConfig",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = PostConfigRequest::class))], required = true),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = PostConfigRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)], required = true),
parameters = [
Parameter(`in` = ParameterIn.PATH, name = "name", required = true)
],
Expand Down Expand Up @@ -71,7 +71,7 @@ import org.springframework.web.bind.annotation.RequestMethod
path = "/v1/admin/configs/{name}/{id}", method = [RequestMethod.PATCH], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "patchConfig",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = PatchConfigRequest::class))], required = true),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = PatchConfigRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)], required = true),
parameters = [
Parameter(`in` = ParameterIn.PATH, name = "name", required = true),
Parameter(`in` = ParameterIn.PATH, name = "id", required = true)
Expand All @@ -94,7 +94,7 @@ import org.springframework.web.bind.annotation.RequestMethod
path = "/v1/admin/popups", method = [RequestMethod.POST], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "postPopup",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = PostPopupRequest::class))], required = true),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = PostPopupRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)], required = true),
responses = [ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = PopupResponse::class))])],
),
),
Expand Down
24 changes: 12 additions & 12 deletions api/src/main/kotlin/router/docs/AuthDocs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,87 +27,87 @@ import org.springframework.web.bind.annotation.RequestMethod
path = "/v1/auth/register_local", method = [RequestMethod.POST], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "registerLocal",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = LocalRegisterRequest::class))]),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = LocalRegisterRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)]),
responses = [ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = LoginResponse::class))])]
),
),
RouterOperation(
path = "/v1/auth/login_local", method = [RequestMethod.POST], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "loginLocal",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = LocalLoginRequest::class))]),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = LocalLoginRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)]),
responses = [ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = LoginResponse::class))])]
),
),
RouterOperation(
path = "/v1/auth/login_fb", method = [RequestMethod.POST], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "loginFacebookLegacy",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = FacebookLoginRequest::class))]),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = FacebookLoginRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)]),
responses = [ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = LoginResponse::class))])]
),
),
RouterOperation(
path = "/v1/auth/login/facebook", method = [RequestMethod.POST], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "loginFacebook",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = SocialLoginRequest::class))]),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = SocialLoginRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)]),
responses = [ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = LoginResponse::class))])]
),
),
RouterOperation(
path = "/v1/auth/login/google", method = [RequestMethod.POST], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "loginGoogle",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = SocialLoginRequest::class))]),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = SocialLoginRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)]),
responses = [ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = LoginResponse::class))])]
),
),
RouterOperation(
path = "/v1/auth/login/kakao", method = [RequestMethod.POST], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "loginKakao",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = SocialLoginRequest::class))]),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = SocialLoginRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)]),
responses = [ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = LoginResponse::class))])]
),
),
RouterOperation(
path = "/v1/auth/logout", method = [RequestMethod.POST], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "logout",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = LogoutRequest::class))]),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = LogoutRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)]),
responses = [ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = OkResponse::class))])]
),
),
RouterOperation(
path = "/v1/auth/find_id", method = [RequestMethod.POST], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "findId",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = SendEmailRequest::class))]),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = SendEmailRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)]),
responses = [ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = OkResponse::class))])]
),
),
RouterOperation(
path = "/v1/auth/password/reset", method = [RequestMethod.POST], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "resetPassword",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = PasswordResetRequest::class))]),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = PasswordResetRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)]),
responses = [ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = OkResponse::class))])]
),
),
RouterOperation(
path = "/v1/auth/password/reset/email/check", method = [RequestMethod.POST], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "getMaskedEmail",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = GetMaskedEmailRequest::class))]),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = GetMaskedEmailRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)]),
responses = [ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = EmailResponse::class))])]
),
),
RouterOperation(
path = "/v1/auth/password/reset/email/send", method = [RequestMethod.POST], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "sendResetPasswordCode",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = SendEmailRequest::class))]),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = SendEmailRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)]),
responses = [
ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = OkResponse::class))])
]
Expand All @@ -117,7 +117,7 @@ import org.springframework.web.bind.annotation.RequestMethod
path = "/v1/auth/password/reset/verification/code", method = [RequestMethod.POST], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "verifyResetPasswordCode",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = VerificationCodeRequest::class))]),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = VerificationCodeRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)]),
responses = [
ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = OkResponse::class))])
]
Expand Down
5 changes: 3 additions & 2 deletions api/src/main/kotlin/router/docs/BookmarkDocs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import org.springframework.web.bind.annotation.RequestMethod
path = "/v1/bookmarks/lectures/{lectureId}/state", method = [RequestMethod.GET], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "existsBookmarkLecture",
parameters = [Parameter(`in` = ParameterIn.PATH, name = "lectureId", required = true)],
responses = [
ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = ExistenceResponse::class))]),
]
Expand All @@ -40,15 +41,15 @@ import org.springframework.web.bind.annotation.RequestMethod
path = "/v1/bookmarks/lecture", method = [RequestMethod.POST], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "addLecture",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = BookmarkLectureModifyRequest::class))]),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = BookmarkLectureModifyRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)]),
responses = [ApiResponse(responseCode = "200", content = [Content(schema = Schema())])]
),
),
RouterOperation(
path = "/v1/bookmarks/lecture", method = [RequestMethod.DELETE], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "deleteBookmark",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = BookmarkLectureModifyRequest::class))]),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = BookmarkLectureModifyRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)]),
responses = [ApiResponse(responseCode = "200", content = [Content(schema = Schema())])]
),
),
Expand Down
4 changes: 2 additions & 2 deletions api/src/main/kotlin/router/docs/FriendDocs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import org.springframework.web.bind.annotation.RequestMethod
operation = Operation(
operationId = "requestFriend",
requestBody = RequestBody(
content = [Content(schema = Schema(implementation = FriendRequest::class))],
content = [Content(schema = Schema(implementation = FriendRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)],
required = true,
),
responses = [ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = FriendsResponse::class))])]
Expand All @@ -61,7 +61,7 @@ import org.springframework.web.bind.annotation.RequestMethod
operation = Operation(
operationId = "updateFriendDisplayName",
requestBody = RequestBody(
content = [Content(schema = Schema(implementation = UpdateFriendDisplayNameRequest::class))],
content = [Content(schema = Schema(implementation = UpdateFriendDisplayNameRequest::class), mediaType = MediaType.APPLICATION_JSON_VALUE)],
required = true,
),
parameters = [Parameter(`in` = ParameterIn.PATH, name = "friendId", required = true)],
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/kotlin/router/docs/LectureSearchDocs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.RequestMethod
path = "/v1/search_query", method = [RequestMethod.POST], produces = [MediaType.APPLICATION_JSON_VALUE],
operation = Operation(
operationId = "searchLecture",
requestBody = RequestBody(content = [Content(schema = Schema(implementation = SearchQueryLegacy::class))]),
requestBody = RequestBody(content = [Content(schema = Schema(implementation = SearchQueryLegacy::class), mediaType = MediaType.APPLICATION_JSON_VALUE)]),
responses = [ApiResponse(responseCode = "200", content = [Content(array = ArraySchema(schema = Schema(implementation = LectureDto::class)))])]
),
),
Expand Down
4 changes: 2 additions & 2 deletions api/src/main/kotlin/router/docs/ThemeDocs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import org.springframework.web.bind.annotation.RequestMethod
operation = Operation(
operationId = "addTheme",
requestBody = RequestBody(
content = [Content(schema = Schema(implementation = TimetableThemeAddRequestDto::class))],
content = [Content(schema = Schema(implementation = TimetableThemeAddRequestDto::class), mediaType = MediaType.APPLICATION_JSON_VALUE)],
required = true,
),
responses = [ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = TimetableThemeDto::class))])],
Expand All @@ -41,7 +41,7 @@ import org.springframework.web.bind.annotation.RequestMethod
operationId = "modifyTheme",
parameters = [Parameter(`in` = ParameterIn.PATH, name = "themeId", required = true)],
requestBody = RequestBody(
content = [Content(schema = Schema(implementation = TimetableThemeAddRequestDto::class))],
content = [Content(schema = Schema(implementation = TimetableThemeAddRequestDto::class), mediaType = MediaType.APPLICATION_JSON_VALUE)],
required = true,
),
responses = [ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = TimetableThemeDto::class))])],
Expand Down
Loading

0 comments on commit 5b600a0

Please sign in to comment.