The request body that you show us is incorrect, there are some extra square brackets inside the country value.
The request body should be like this:
{
"name": "someplace",
"country": {
"name": "somecountry"
}
}
The following setup worked for me, in case you need some reference:
@EnableAutoConfiguration
@ComponentScan
@RestController
public class Main {
public static void main(String[] args) {
SpringApplication.run(Main.class, args);
}
@RequestMapping(value = "/region", method = RequestMethod.POST)
public void region(@RequestBody Area area) {
System.out.println("Received area: " + area);
}
}