study/TIL🐥

[JAVA/Spring] [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unexpected character ('}' (code 125))

서나쓰 2022. 8. 5. 15:06
728x90
Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unexpected character ('}' (code 125)): was expecting double-quote to start field name; nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character ('}' (code 125)): was expecting double-quote to start field name<EOL> at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 4, column: 2]]

 

Sample json

{ "subject": "재목", "contents": "내용", }

 

해결책

json 규칙에 맨 마지막 항목에는 ' , ' 이 붙으면 안 된다.

쉼표 삭제하니 정상 작동

728x90