{"action":"closed","issue":{"url":"https://api.github.com/repos/eugenp/tutorials/issues/4111","repository_url":"https://api.github.com/repos/eugenp/tutorials","labels_url":"https://api.github.com/repos/eugenp/tutorials/issues/4111/labels{/name}","comments_url":"https://api.github.com/repos/eugenp/tutorials/issues/4111/comments","events_url":"https://api.github.com/repos/eugenp/tutorials/issues/4111/events","html_url":"https://github.com/eugenp/tutorials/issues/4111","id":318180359,"number":4111,"title":"Jackson MismatchedInputException","user":{"login":"vijaysl","id":10793780,"avatar_url":"https://avatars1.githubusercontent.com/u/10793780?v=4","gravatar_id":"","url":"https://api.github.com/users/vijaysl","html_url":"https://github.com/vijaysl","followers_url":"https://api.github.com/users/vijaysl/followers","following_url":"https://api.github.com/users/vijaysl/following{/other_user}","gists_url":"https://api.github.com/users/vijaysl/gists{/gist_id}","starred_url":"https://api.github.com/users/vijaysl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vijaysl/subscriptions","organizations_url":"https://api.github.com/users/vijaysl/orgs","repos_url":"https://api.github.com/users/vijaysl/repos","events_url":"https://api.github.com/users/vijaysl/events{/privacy}","received_events_url":"https://api.github.com/users/vijaysl/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-26T20:13:19Z","updated_at":"2018-04-28T07:07:07Z","closed_at":"2018-04-28T07:07:07Z","author_association":"NONE","body":"Hi Eugen, \r\nApologize if this is not the right place for this question.\r\nIn the Spring Data Rest example, it will also be helpful to add the following example where you can associate a relationship directly.\r\n\r\n- curl -i -X POST -H \"Content-Type:application/json\" -d '{\"name\":\"My Library\"}' http://localhost:8080/libraries\r\n- curl -i -X POST -d '{\"title\":\"Books\", \"library\":\"http://localhost:8080/libraries/1\"}' -H \"Content-Type:application/json\" http://localhost:8080/books\r\n\r\nThis works in Java and when using a regular class for the JPA entity. However, if I change this to a kotlin data class this fails with the following error\r\ncom.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `com.baeldung.models.Library` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('http://localhost:8080/libraries/1')\r\n\r\nI have shared the updated code under https://github.com/vijaysl/spring-data-rest.git\r\n\r\nAppreciate any feedback.\r\n\r\nThanks,\r\nVijay\r\n"}}
{"actor":{"display_login":"lor6"}}