[TIL] 422 Unprocessable Entity from POST

·2023년 2월 23일
0

API 서버 -> 레드마인 API를 웹클라이언트를 이용해서 호출하고 있는데 422 Unprocessable Entity from POST 에러가 발생했다 ㅋ

422 에러 : 데이터 타입이 유효하지 않을 때 발생함

에러메세지

2023-02-16 11:14:28.785 ERROR 66569 --- [nio-8081-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.reactive.function.client.WebClientResponseException$UnprocessableEntity: 422 Unprocessable Entity from POST http://100.0.0.157:30180/issues.json] with root cause

org.springframework.web.reactive.function.client.WebClientResponseException$UnprocessableEntity: 422 Unprocessable Entity from POST http://100.0.0.157:30180/issues.json
	at org.springframework.web.reactive.function.client.WebClientResponseException.create(WebClientResponseException.java:237) ~[spring-webflux-5.3.24.jar:5.3.24]
	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
Error has been observed at the following site(s):
	*__checkpoint ⇢ 422 from POST

case 1 : null로 보냈으면 null로 보냈지, 0으로는 보내지 마라

기존 초기값

assignedId : 0

다음과 같이 변경

assignedId : null, // 초기값이 0인 경우 api -> webclient -> 레드마인 api 호출 시, 422 에러 발생 

case 2 : 중복된 회원이 존재할 경우

이번에도 데이터 타입이 뭐가 문제가 있나 싶어서 id랑 mail을 다르게 했더니 성공했다 ㅠ

login과 mail의 값을 변경함

해당 데이터를 다시 전송하면 422 에러 발생


profile
더 있을수도 있음.. 내가 모를수도.. 떠올리지 못했을수도.. 내가 무지했을수도..

0개의 댓글

관련 채용 정보