{"action":"created","issue":{"url":"https://api.github.com/repos/bluelinelabs/LoganSquare/issues/68","labels_url":"https://api.github.com/repos/bluelinelabs/LoganSquare/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/bluelinelabs/LoganSquare/issues/68/comments","events_url":"https://api.github.com/repos/bluelinelabs/LoganSquare/issues/68/events","html_url":"https://github.com/bluelinelabs/LoganSquare/issues/68","id":89516539,"number":68,"title":"Support @JsonDeserializeField and @JsonSerializeField","user":{"login":"yongjhih","id":213736,"avatar_url":"https://avatars.githubusercontent.com/u/213736?v=3","gravatar_id":"","url":"https://api.github.com/users/yongjhih","html_url":"https://github.com/yongjhih","followers_url":"https://api.github.com/users/yongjhih/followers","following_url":"https://api.github.com/users/yongjhih/following{/other_user}","gists_url":"https://api.github.com/users/yongjhih/gists{/gist_id}","starred_url":"https://api.github.com/users/yongjhih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongjhih/subscriptions","organizations_url":"https://api.github.com/users/yongjhih/orgs","repos_url":"https://api.github.com/users/yongjhih/repos","events_url":"https://api.github.com/users/yongjhih/events{/privacy}","received_events_url":"https://api.github.com/users/yongjhih/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-19T09:29:54Z","updated_at":"2015-06-19T20:38:58Z","closed_at":null,"body":"For example:\r\n\r\n```java\r\npublic class Post {\r\n  @JsonDeserializeField Place place; // place: { id: \"\", street: \"\", city: \"\"}\r\n  @JsonSerializeField(name = \"place\") String placeId; // place: \"1234567\";\r\n}\r\n```\r\n\r\nor we'd like to implement `TypeConverter<Place>`\r\n\r\n```java\r\npublic static class PlaceTypeConverter implements TypeConverter<Place> {\r\n  @Override public Place parse(JsonParser jsonParser) throws IOException {\r\n    return Place$$JsonObjectMapper._parse(jsonParser);\r\n  }\r\n  @Override public void serialize(Place object, String fieldName, boolean writeFieldNameForObject, JsonGenerator jsonGenerator) throws IOException {\r\n    jsonGenerator.writeStringField(fieldName, object.id);\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/bluelinelabs/LoganSquare/issues/comments/113634839","html_url":"https://github.com/bluelinelabs/LoganSquare/issues/68#issuecomment-113634839","issue_url":"https://api.github.com/repos/bluelinelabs/LoganSquare/issues/68","id":113634839,"user":{"login":"EricKuck","id":2039026,"avatar_url":"https://avatars.githubusercontent.com/u/2039026?v=3","gravatar_id":"","url":"https://api.github.com/users/EricKuck","html_url":"https://github.com/EricKuck","followers_url":"https://api.github.com/users/EricKuck/followers","following_url":"https://api.github.com/users/EricKuck/following{/other_user}","gists_url":"https://api.github.com/users/EricKuck/gists{/gist_id}","starred_url":"https://api.github.com/users/EricKuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EricKuck/subscriptions","organizations_url":"https://api.github.com/users/EricKuck/orgs","repos_url":"https://api.github.com/users/EricKuck/repos","events_url":"https://api.github.com/users/EricKuck/events{/privacy}","received_events_url":"https://api.github.com/users/EricKuck/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T20:38:58Z","updated_at":"2015-06-19T20:38:58Z","body":"This is already possible with the existing annotations. Here's how you'd do it:\r\n\r\n```\r\n    // This one will only be parsed, as it's set to ignore serialization\r\n    @JsonField\r\n    @JsonIgnore(ignorePolicy = IgnorePolicy.SERIALIZE_ONLY)\r\n    public List<Place> places;\r\n\r\n    // This one will only be serialized, as it's set to ignore parsing\r\n    @JsonField(name = \"places\")\r\n    @JsonIgnore(ignorePolicy = IgnorePolicy.PARSE_ONLY)\r\n    List<Long> placeIds;\r\n```"}}