Skip to content

Commit 7cae153

Browse files
committed
Doces: User API Swagger 문서 보완
1 parent ba70cbb commit 7cae153

File tree

1 file changed

+54
-18
lines changed

1 file changed

+54
-18
lines changed

src/main/java/com/back/domain/user/controller/UserControllerDocs.java

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,35 @@ public interface UserControllerDocs {
8787
),
8888
@ApiResponse(
8989
responseCode = "401",
90-
description = "인증 실패 (토큰 없음/만료/잘못됨)",
90+
description = "인증 실패 (Access Token 문제)",
9191
content = @Content(
9292
mediaType = "application/json",
93-
examples = @ExampleObject(value = """
94-
{
95-
"success": false,
96-
"code": "AUTH_401",
97-
"message": "인증이 필요합니다.",
98-
"data": null
99-
}
100-
""")
93+
examples = {
94+
@ExampleObject(name = "토큰 없음", value = """
95+
{
96+
"success": false,
97+
"code": "AUTH_001",
98+
"message": "인증이 필요합니다.",
99+
"data": null
100+
}
101+
"""),
102+
@ExampleObject(name = "유효하지 않은 토큰", value = """
103+
{
104+
"success": false,
105+
"code": "AUTH_002",
106+
"message": "유효하지 않은 액세스 토큰입니다.",
107+
"data": null
108+
}
109+
"""),
110+
@ExampleObject(name = "만료된 토큰", value = """
111+
{
112+
"success": false,
113+
"code": "AUTH_004",
114+
"message": "만료된 액세스 토큰입니다.",
115+
"data": null
116+
}
117+
""")
118+
}
101119
)
102120
),
103121
@ApiResponse(
@@ -219,17 +237,35 @@ ResponseEntity<RsData<UserDetailResponse>> getMyInfo(
219237
),
220238
@ApiResponse(
221239
responseCode = "401",
222-
description = "인증 실패 (토큰 없음/만료/잘못됨)",
240+
description = "인증 실패 (토큰 없음/잘못됨/만료)",
223241
content = @Content(
224242
mediaType = "application/json",
225-
examples = @ExampleObject(value = """
226-
{
227-
"success": false,
228-
"code": "AUTH_401",
229-
"message": "인증이 필요합니다.",
230-
"data": null
231-
}
232-
""")
243+
examples = {
244+
@ExampleObject(name = "토큰 없음", value = """
245+
{
246+
"success": false,
247+
"code": "AUTH_001",
248+
"message": "인증이 필요합니다.",
249+
"data": null
250+
}
251+
"""),
252+
@ExampleObject(name = "잘못된 토큰", value = """
253+
{
254+
"success": false,
255+
"code": "AUTH_002",
256+
"message": "유효하지 않은 액세스 토큰입니다.",
257+
"data": null
258+
}
259+
"""),
260+
@ExampleObject(name = "만료된 토큰", value = """
261+
{
262+
"success": false,
263+
"code": "AUTH_004",
264+
"message": "만료된 액세스 토큰입니다.",
265+
"data": null
266+
}
267+
""")
268+
}
233269
)
234270
),
235271
@ApiResponse(

0 commit comments

Comments
 (0)