{"action":"created","issue":{"url":"https://api.github.com/repos/HubSpot/Rosetta/issues/31","repository_url":"https://api.github.com/repos/HubSpot/Rosetta","labels_url":"https://api.github.com/repos/HubSpot/Rosetta/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/HubSpot/Rosetta/issues/31/comments","events_url":"https://api.github.com/repos/HubSpot/Rosetta/issues/31/events","html_url":"https://github.com/HubSpot/Rosetta/issues/31","id":152758286,"number":31,"title":"Exception when trying to @JsonSerialized a nested polymorphic field annotated with @JsonTypeInfo ","user":{"login":"rscarvalho","id":83680,"avatar_url":"https://avatars.githubusercontent.com/u/83680?v=3","gravatar_id":"","url":"https://api.github.com/users/rscarvalho","html_url":"https://github.com/rscarvalho","followers_url":"https://api.github.com/users/rscarvalho/followers","following_url":"https://api.github.com/users/rscarvalho/following{/other_user}","gists_url":"https://api.github.com/users/rscarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/rscarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rscarvalho/subscriptions","organizations_url":"https://api.github.com/users/rscarvalho/orgs","repos_url":"https://api.github.com/users/rscarvalho/repos","events_url":"https://api.github.com/users/rscarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/rscarvalho/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-03T12:08:03Z","updated_at":"2016-05-03T12:15:53Z","closed_at":null,"body":"I have this field that is annotated as `@StoredAsJson` and it's type is interface `FilterValue`. In `FilterValue`, I have `@JsonTypeInfo` and `@JsonSubTypes` configured properly, also having like classes `StringValue` and `NumberValue` implementing that interface.\r\n\r\nThe serialization works fine, but it's failing to deserialize the values back from the database. When I try to fetch the object from the database with my DAO I get the following error:\r\n\r\n```\r\ncom.fasterxml.jackson.databind.JsonMappingException: Unexpected token (VALUE_STRING), expected START_ARRAY: need JSON Array to contain As.WRAPPER_ARRAY type information for class io.github.rscarvalho.rosettatest.data.FilterValue\r\n at [Source: {\"id\":0,\"name\":\"filter1\",\"filterValue\":\"{\\\"@type\\\":\\\"StringValue\\\",\\\"value\\\":\\\"my value\\\"}\"}; line: 1, column: 25] (through reference chain: io.github.rscarvalho.rosettatest.data.Filter[\"filterValue\"])\r\n```\r\n\r\nI've set up [a repository](https://github.com/rscarvalho/RosettaJdbiJsonTypeInfo) with a small test to reproduce the issue. You can see the original error message into the [Travis build](https://travis-ci.org/rscarvalho/RosettaJdbiJsonTypeInfo) that failed the same way as my local tests."},"comment":{"url":"https://api.github.com/repos/HubSpot/Rosetta/issues/comments/216509814","html_url":"https://github.com/HubSpot/Rosetta/issues/31#issuecomment-216509814","issue_url":"https://api.github.com/repos/HubSpot/Rosetta/issues/31","id":216509814,"user":{"login":"rscarvalho","id":83680,"avatar_url":"https://avatars.githubusercontent.com/u/83680?v=3","gravatar_id":"","url":"https://api.github.com/users/rscarvalho","html_url":"https://github.com/rscarvalho","followers_url":"https://api.github.com/users/rscarvalho/followers","following_url":"https://api.github.com/users/rscarvalho/following{/other_user}","gists_url":"https://api.github.com/users/rscarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/rscarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rscarvalho/subscriptions","organizations_url":"https://api.github.com/users/rscarvalho/orgs","repos_url":"https://api.github.com/users/rscarvalho/repos","events_url":"https://api.github.com/users/rscarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/rscarvalho/received_events","type":"User","site_admin":false},"created_at":"2016-05-03T12:15:53Z","updated_at":"2016-05-03T12:15:53Z","body":"@ldriscoll when you configure `use = JsonTypeInfo.Id.NAME` on `@JsonTypeInfo` it does only records the simple class name.\r\n\r\nFrom what I understand Jackson should be picking up which class to use based on the configured `@JsonSubTypes` "}}