{"action":"created","issue":{"url":"https://api.github.com/repos/scm-spain/karyon-rest-router/issues/11","labels_url":"https://api.github.com/repos/scm-spain/karyon-rest-router/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/scm-spain/karyon-rest-router/issues/11/comments","events_url":"https://api.github.com/repos/scm-spain/karyon-rest-router/issues/11/events","html_url":"https://github.com/scm-spain/karyon-rest-router/pull/11","id":108877198,"number":11,"title":"Feature/out interceptor","user":{"login":"padilo","id":783959,"avatar_url":"https://avatars.githubusercontent.com/u/783959?v=3","gravatar_id":"","url":"https://api.github.com/users/padilo","html_url":"https://github.com/padilo","followers_url":"https://api.github.com/users/padilo/followers","following_url":"https://api.github.com/users/padilo/following{/other_user}","gists_url":"https://api.github.com/users/padilo/gists{/gist_id}","starred_url":"https://api.github.com/users/padilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/padilo/subscriptions","organizations_url":"https://api.github.com/users/padilo/orgs","repos_url":"https://api.github.com/users/padilo/repos","events_url":"https://api.github.com/users/padilo/events{/privacy}","received_events_url":"https://api.github.com/users/padilo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-29T14:06:59Z","updated_at":"2015-09-30T09:20:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scm-spain/karyon-rest-router/pulls/11","html_url":"https://github.com/scm-spain/karyon-rest-router/pull/11","diff_url":"https://github.com/scm-spain/karyon-rest-router/pull/11.diff","patch_url":"https://github.com/scm-spain/karyon-rest-router/pull/11.patch"},"body":"Added interceptors to endpoint paths.\r\n\r\nThis way we are able to intercept the return Observable of each @Path method to do things after the controller methods ends.\r\n\r\nThere is an example of how to do a Json serializer interceptor thats accepts any kind of Observable and tries to serialize it as JSON.\r\n\r\nTake a look at AppServer to see how to add an interceptor (you can add as many as you like).\r\nAt ExampleEndpointController there is a method getEndpointWithQueryParamsReturnDTOToPrintJson, that returns an Observable DTO.\r\n\r\nWe (me and @borjavh) will add the documentation to the wiki if this PR is going to be accepted. :)\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/scm-spain/karyon-rest-router/issues/comments/144336027","html_url":"https://github.com/scm-spain/karyon-rest-router/pull/11#issuecomment-144336027","issue_url":"https://api.github.com/repos/scm-spain/karyon-rest-router/issues/11","id":144336027,"user":{"login":"enriclluelles","id":79768,"avatar_url":"https://avatars.githubusercontent.com/u/79768?v=3","gravatar_id":"","url":"https://api.github.com/users/enriclluelles","html_url":"https://github.com/enriclluelles","followers_url":"https://api.github.com/users/enriclluelles/followers","following_url":"https://api.github.com/users/enriclluelles/following{/other_user}","gists_url":"https://api.github.com/users/enriclluelles/gists{/gist_id}","starred_url":"https://api.github.com/users/enriclluelles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enriclluelles/subscriptions","organizations_url":"https://api.github.com/users/enriclluelles/orgs","repos_url":"https://api.github.com/users/enriclluelles/repos","events_url":"https://api.github.com/users/enriclluelles/events{/privacy}","received_events_url":"https://api.github.com/users/enriclluelles/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T09:20:20Z","updated_at":"2015-09-30T09:20:20Z","body":"I'm mostly +1 on this since we could use this as the basis for getting \"content-type\"-like annotations, but I have some concers that I tried to address in the line comments. \r\nAlso I think that having a global set of interceptors is a bit naive and we would be better off having differents subsets of them and handle which ones are applied by tagging paths and even endpoints.\r\nHow does that sound?"}}