반응형
일반적으로 Controller 에 Request를 Vo로 받는것이 권장되지만
부득이하게 Map으로 받아야되는경우 아래와같이 Swagger를 작성할수 있습니다
@Tag(name = "테스트")
@Operation(parameters = {
@Parameter(name = "test1", description = "테스트1", required = true, example = "1"),
@Parameter(name = "test2", description = "테스트2", required = true, example = "2")
})
@PostMapping("/api/test")
HashMap<String, Object> test (@RequestParam HashMap<String, Object> param){
return null;
}

Parameter hidden 처리를 안해주면 예제 prop가 나타납니다
그대로 놔둬도 상관없지만 혼란방지를 위해 hidden 처리를 해줍니다
반응형
'개발 > Spring' 카테고리의 다른 글
| [Spring 실전] 2. 인증 (웹) (0) | 2025.06.19 |
|---|---|
| [Spring 실전] 1. 멀티모듈 (0) | 2025.06.18 |
| Itext 를 이용하여 PDF 에 QR코드 넣기 (0) | 2025.03.11 |
| Querydsl 에서 datetime과 date 비교하기 (0) | 2023.07.10 |
| Description 을 사용하자 (0) | 2023.06.20 |