본문 바로가기
반응형
Spring/REST API(eng)

Spring Error: resolved [org.springframework.web.httpmediatypenotsupportedexception: content type '' not supported, Error: response status is 415

by brightGarden02 2022. 12. 2.

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. 

 

댓글


반응형
반응형