Closed javac9 closed 5 years ago
Hi,
I've written a simple create method for the Employee entity, but attributes of the object received are null:
@RequestMapping(value = "/employees", method = RequestMethod.POST, consumes = MediaTypes.HAL_JSON_VALUE) public Employee create(Employee employee){ return repository.save(employee); }
@RequestMapping(value = "/employees", method = RequestMethod.POST, consumes = MediaTypes.HAL_JSON_VALUE)
public Employee create(Employee employee){
return repository.save(employee);
}
Could you please update the repo with such a simple but working example or at least try to explain what could be the issue here? Thank you very much!
The input is missing @RequestBody annotation.
@RequestBody
Hi,
I've written a simple create method for the Employee entity, but attributes of the object received are null:
@RequestMapping(value = "/employees", method = RequestMethod.POST, consumes = MediaTypes.HAL_JSON_VALUE)
public Employee create(Employee employee){
return repository.save(employee);
}
Could you please update the repo with such a simple but working example or at least try to explain what could be the issue here? Thank you very much!