With this code
@RequestMapping(value = \"/bar/foo\", method = RequestMethod.GET)
public ResponseEntity foo() {
Foo model;
...
I saw the same error when the scope of the jackson-databind
dependency had been set to test
:
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.9</version>
<scope>test</scope>
</dependency>
Removing the <scope>
line fixed the issue.
The issue occurred in my case because spring framework couldn't fetch the properties of nested objects. Getters/Setters is one way of solving. Making the properties public is another quick and dirty solution to validate if this is indeed the problem.