title: Spring Data REST: "no String-argument constructor/factory method to deserialize from String value"
body: <p>When I use Lombok in my Spring Data REST application to define complex types like:</p>
  
  <pre><code>@NoArgsConstructor
  @AllArgsConstructor
  @Data
  
  @Entity
  @Table(name = "BOOK")
  public class Book {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(nullable = false)
      private Long id;
  
      private String title;
  
      @ManyToOne(cascade = {CascadeType.DETACH, CascadeType.MERGE, CascadeType.REFRESH})
      private Person author;
  
      // ...
  }
  </code></pre>
  
  <p>with a Spring Data REST controllers like:</p>
  
  <pre><code>@RepositoryRestController
  public class BookRepositoryRestController {
  
      private final BookRepository repository;
  
      @Autowired
      public BookRepositoryRestController(BookRepository repository) {
          this.repository = repository;
      }
  
      @RequestMapping(method = RequestMethod.POST,value = "/books")
      public @ResponseBody PersistentEntityResource post(
          @RequestBody Book book,
          PersistentEntityResourceAssembler assembler) {
  
          Book entity = processPost(book);
  
          return assembler.toResource(entity);
      }
  
      private Book processPost(Book book) {
          // ...
          return this.repository.save(book);
      }
  }
  </code></pre>
  
  <p>I get an ugly error:</p>
  
  <pre><code>no String-argument constructor/factory method to deserialize from String value
  </code></pre>
  
  <p>from Spring Data REST's use of Jackson with a Book POST like:</p>
  
  <pre><code>curl -X POST 
       -H 'content-type: application/json' 
       -d '{"title":"Skip Like a Pro", "author": "/people/123"}'
       http://localhost:8080/api/books/
  </code></pre>
  
  <p>The de-serialization error happens when Jackson tries to resolve the <code>/people/123</code> local URI which should resolve to a single, unique <code>Person</code>. If I remove my <code>@RepositoryRestController</code>, everything works fine. Any idea what's wrong with my REST controller definition?</p>