When I was using Swagger with Spring, I got error.
Error: resolved [org.springframework.web.httpmediatypenotsupportedexception: content type '' not supported
How I solved:
Add consumes = ALL_VALUE inside @GetMapping parenthesis
@Operation(description = "개인정보조회", security = @SecurityRequirement(name = "bearerAuth"))
@GetMapping(value = "/info", consumes = ALL_VALUE)
public ResponseEntity<RsData<MemberResponse>> menteeInfo(@Parameter @Valid MemberEmailRequest request) {
MemberDto memberDto = menteeMyPageService.findByEmail(request.getEmail());
return Ut.sp.responseEntityOf
(RsData.successOf(new MemberResponse(memberDto)));
}
This is the result secreen of Swagger Execute with error resolved.
댓글