spring-projects / spring-hateoas-examples

Collection of examples on how (and why) to build hypermedia-driven apps with Spring HATEOAS
Apache License 2.0
384 stars 186 forks source link

Cannot make POST request -- object attributes are null on arrival #10

Closed javac9 closed 5 years ago

javac9 commented 6 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); }

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!

gregturn commented 6 years ago

The input is missing @RequestBody annotation.