objectmapper1 [Spring] UnrecognizedPropertyException / 컨트롤러에서 JSON 요청 받을 때 매핑되는 프로퍼티가 없는 경우 JSON 요청에 필요없는 데이터가 같이 들어오는 경우 JSON을 JAVA 오브젝트로 매핑할 때 UnrecognizedPropertyException이 발생한다. { "id": "1234", "name": "fien", "phone": "010-1234-5678" } public class ReqeustDto { private String Id; private String name; } @PostMapping(value = "/{id}") public ResponseEntity createUser(@PathVariable String id, @RequestBody RequestDto reqDto){ // phone이 매핑되지 않아 UnrecognizedPropertyException 발생 } 물론 요청 시.. 2021. 6. 14. 이전 1 다음