{"action":"created","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-gateway/issues/298","repository_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gateway","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gateway/issues/298/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gateway/issues/298/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gateway/issues/298/events","html_url":"https://github.com/spring-cloud/spring-cloud-gateway/issues/298","id":317144682,"number":298,"title":"The user can not control serialization / deserialization when modifying HTTP messages.","user":{"login":"re6exp","id":2945539,"avatar_url":"https://avatars0.githubusercontent.com/u/2945539?v=4","gravatar_id":"","url":"https://api.github.com/users/re6exp","html_url":"https://github.com/re6exp","followers_url":"https://api.github.com/users/re6exp/followers","following_url":"https://api.github.com/users/re6exp/following{/other_user}","gists_url":"https://api.github.com/users/re6exp/gists{/gist_id}","starred_url":"https://api.github.com/users/re6exp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/re6exp/subscriptions","organizations_url":"https://api.github.com/users/re6exp/orgs","repos_url":"https://api.github.com/users/re6exp/repos","events_url":"https://api.github.com/users/re6exp/events{/privacy}","received_events_url":"https://api.github.com/users/re6exp/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-gateway/milestones/13","html_url":"https://github.com/spring-cloud/spring-cloud-gateway/milestone/13","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gateway/milestones/13/labels","id":3193958,"number":13,"title":"2.0.0.RC1","description":null,"creator":{"login":"spencergibb","id":594085,"avatar_url":"https://avatars3.githubusercontent.com/u/594085?v=4","gravatar_id":"","url":"https://api.github.com/users/spencergibb","html_url":"https://github.com/spencergibb","followers_url":"https://api.github.com/users/spencergibb/followers","following_url":"https://api.github.com/users/spencergibb/following{/other_user}","gists_url":"https://api.github.com/users/spencergibb/gists{/gist_id}","starred_url":"https://api.github.com/users/spencergibb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spencergibb/subscriptions","organizations_url":"https://api.github.com/users/spencergibb/orgs","repos_url":"https://api.github.com/users/spencergibb/repos","events_url":"https://api.github.com/users/spencergibb/events{/privacy}","received_events_url":"https://api.github.com/users/spencergibb/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":23,"state":"closed","created_at":"2018-03-16T18:08:08Z","updated_at":"2018-04-24T16:34:38Z","due_on":null,"closed_at":"2018-04-24T16:34:38Z"},"comments":4,"created_at":"2018-04-24T09:32:19Z","updated_at":"2018-04-24T18:34:17Z","closed_at":"2018-04-24T16:16:16Z","author_association":"NONE","body":"@spencergibb \r\nFirst of all, thank you for adding the functionality to modifying request/response body!\r\nRemoving unnecessary code from my branch with overcome the need of wrappers looks brilliant!\r\n\r\nBut there is some significant drawback in this realization.\r\n[Here](https://github.com/spring-cloud/spring-cloud-gateway/blob/9877e90f9d7e3a450d0efeb66475e27c6da75e3c/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/handler/predicate/ReadBodyPredicateFactory.java#L58) and [here](https://github.com/spring-cloud/spring-cloud-gateway/blob/9877e90f9d7e3a450d0efeb66475e27c6da75e3c/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/handler/predicate/ReadBodyPredicateFactory.java#L66) are used nulls. This corrupts serialization / deserialization.\r\n\r\nIn the state as it is implemented now, I can not use the new changes. I suggest to add hints as I do in my [branch](https://github.com/re6exp/spring-cloud-gateway/blob/920472f23f525aa65049f533d9b7ad91eda69108/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/body/RewriteResponseBodyFilterSpec.java#L89). \r\n\r\nWhen I attempt to use hints like:\r\n```\r\nfinal Map<String, Object> responseToCookiesHintsOut = new HashMap<>();\r\n\t\tresponseToCookiesHintsOut.put(JSON_VIEW_HINT, Deserializable.class);\r\n```\r\non json objects that are taken from the server behind gateway:\r\n<pre>\r\npublic class Token {\r\n\t\r\n\tpublic interface Deserializable {\r\n\t}\r\n\r\n\tpublic Token() {\r\n\t}\r\n\r\n\t@JsonProperty(\"access_token\")\r\n\tprivate String accessToken;\r\n\r\n\t@JsonProperty(\"token_type\")\r\n\tprivate String tokenType;\r\n\r\n\t@JsonProperty(\"refresh_token\")\r\n\tprivate String refreshToken;\r\n\r\n\t@JsonProperty(\"expires_in\")\r\n\tprivate String expiresIn;\r\n\r\n\t@JsonProperty(\"accessExpiresIn\")\r\n\t<b>@JsonView(Deserializable.class)</b>\r\n\tprivate Integer accessTokenExpiresIn;\r\n\r\n\t@JsonProperty(\"refreshExpiresIn\")\r\n        <b>@JsonView(Deserializable.class)</b>\r\n\tprivate Integer refreshTokenExpiresIn;\r\n\r\n\t@JsonProperty(\"scope\")\r\n\tprivate String scope;\r\n\r\n\t@JsonProperty(\"jti\")\r\n\tprivate String jti;\r\n\r\n//   ... ommited\r\n\r\n}\r\n</pre>\r\nclient get all properties  including those I preffer to hide. To overcome this, we could add another entity, but that is a bad practice.\r\n\r\nPlease add hints to both reading and writting."},"comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-gateway/issues/comments/384035592","html_url":"https://github.com/spring-cloud/spring-cloud-gateway/issues/298#issuecomment-384035592","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gateway/issues/298","id":384035592,"user":{"login":"re6exp","id":2945539,"avatar_url":"https://avatars0.githubusercontent.com/u/2945539?v=4","gravatar_id":"","url":"https://api.github.com/users/re6exp","html_url":"https://github.com/re6exp","followers_url":"https://api.github.com/users/re6exp/followers","following_url":"https://api.github.com/users/re6exp/following{/other_user}","gists_url":"https://api.github.com/users/re6exp/gists{/gist_id}","starred_url":"https://api.github.com/users/re6exp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/re6exp/subscriptions","organizations_url":"https://api.github.com/users/re6exp/orgs","repos_url":"https://api.github.com/users/re6exp/repos","events_url":"https://api.github.com/users/re6exp/events{/privacy}","received_events_url":"https://api.github.com/users/re6exp/received_events","type":"User","site_admin":false},"created_at":"2018-04-24T18:34:17Z","updated_at":"2018-04-24T18:34:17Z","author_association":"NONE","body":"@spencergibb \r\nIf you can renew RC1 in maven repo, I could check the changes on my application ASAP. I'm online now."}}
{"actor":{"display_login":"re6exp"}}