{"action":"opened","issue":{"url":"https://api.github.com/repos/Netflix/falcor/issues/665","labels_url":"https://api.github.com/repos/Netflix/falcor/issues/665/labels{/name}","comments_url":"https://api.github.com/repos/Netflix/falcor/issues/665/comments","events_url":"https://api.github.com/repos/Netflix/falcor/issues/665/events","html_url":"https://github.com/Netflix/falcor/issues/665","id":121741149,"number":665,"title":"UnhandledPaths v2 (Master Ticket)","user":{"login":"michaelbpaulson","id":4458174,"avatar_url":"https://avatars.githubusercontent.com/u/4458174?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelbpaulson","html_url":"https://github.com/michaelbpaulson","followers_url":"https://api.github.com/users/michaelbpaulson/followers","following_url":"https://api.github.com/users/michaelbpaulson/following{/other_user}","gists_url":"https://api.github.com/users/michaelbpaulson/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelbpaulson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelbpaulson/subscriptions","organizations_url":"https://api.github.com/users/michaelbpaulson/orgs","repos_url":"https://api.github.com/users/michaelbpaulson/repos","events_url":"https://api.github.com/users/michaelbpaulson/events{/privacy}","received_events_url":"https://api.github.com/users/michaelbpaulson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-11T16:22:13Z","updated_at":"2015-12-11T16:22:13Z","closed_at":null,"body":"Previous spec for unhandledPaths https://github.com/Netflix/falcor/issues/615\r\n\r\n--------------------------\r\nWe believe that composition will be a better path to take moving forward as unhandledPaths leak a notion that something can take care of the missing data. \r\n\r\n### Changes to the Router\r\nThere will be 3 new prototype methods added to the router.  The easiest way to think of the three methods is they have the same input as a [DataSource](http://netflix.github.io/falcor/doc/DataSource.html) but have the same return options as any routed method.\r\n\r\n```javascript\r\n/**\r\n * Takes in a function to execute when all unhandledPaths have been accumulated at the end of a\r\n * router request.\r\n * @param {Function} unhandledHandler - The get handler takes in a list of PathSets and can return\r\n * the same thing any route can, that is pathValues, jsonGraph, promises of either, or observables of\r\n * either.\r\n */\r\nRouter.prototype.onUnhandledGet = function(unhandledHandler) {\r\n}; \r\n/**\r\n * @param {Function} unhandledHandler - The set handler takes in a jsonGraphEnvelope and can \r\n * return same thing as any route.\r\n */\r\nRouter.prototype.onUnhandledSet = function(unhandledHandler) {\r\n};   \r\n/**\r\n * STILL REQUIRES MORE FLUSHING OUT - the paths / suffixes make an interesting facet to\r\n * how much should be taken care of by the unhandler vs the router itself.\r\n * @param {Function} unhandledHandler - The call handler takes in a callPath, arguments, paths, \r\n * and suffixes and can return same thing as any route.\r\n */\r\nRouter.prototype.onUnhandledCall = function(unhandledHandler) {\r\n};   \r\n```\r\n\r\nAfter a get/set/call if there were requests for routes that do not have corresponding handlers in the router then they will be accumulated until the end of the request.  After that the onUnhandled* will have a chance to generate their own jsonGraph.  The `this` object of the unhanlded* is the router object.\r\n\r\n### Changes to the Model\r\nNone.  Horray!\r\n\r\n### Extra Libraries\r\nNone.  Horray!\r\n\r\n### Changes to the JSONGraphEnvelope\r\nNone.  Horray!\r\n\r\n@jhusain @ktrott @sdesai Have we considered the following interface option.  `onUnhandledDataSource(DataSource source)`.  Since the three methods are a piecemeal DataSource with different return options.  Thoughts?"}}