{"action":"created","issue":{"url":"https://api.github.com/repos/bleupen/halacious/issues/55","labels_url":"https://api.github.com/repos/bleupen/halacious/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/bleupen/halacious/issues/55/comments","events_url":"https://api.github.com/repos/bleupen/halacious/issues/55/events","html_url":"https://github.com/bleupen/halacious/issues/55","id":71434126,"number":55,"title":"pass uri template through on href object ","user":{"login":"lsnyder","id":4296733,"avatar_url":"https://avatars.githubusercontent.com/u/4296733?v=3","gravatar_id":"","url":"https://api.github.com/users/lsnyder","html_url":"https://github.com/lsnyder","followers_url":"https://api.github.com/users/lsnyder/followers","following_url":"https://api.github.com/users/lsnyder/following{/other_user}","gists_url":"https://api.github.com/users/lsnyder/gists{/gist_id}","starred_url":"https://api.github.com/users/lsnyder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsnyder/subscriptions","organizations_url":"https://api.github.com/users/lsnyder/orgs","repos_url":"https://api.github.com/users/lsnyder/repos","events_url":"https://api.github.com/users/lsnyder/events{/privacy}","received_events_url":"https://api.github.com/users/lsnyder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-28T00:01:17Z","updated_at":"2015-04-28T00:57:04Z","closed_at":null,"body":"Hey guys,\r\n\r\nNew to hypermedia, so please inform me if this usecase is ridiculous, but I have a situation where I'd like to pass the uri template I'm attaching to the href all the way through to the response without it being expanded. Once my object hits resolveHref() my template gets expanded into and empty string and I lose the template. \r\nThis is desired result:\r\n```\r\n/call/123876213876{?id}\r\n```\r\nGets nuked to this\r\n```\r\n/call/123876213876\r\n```\r\n\r\nThe reason I want the template to pass through is because these links will not always appear on a route that requires the actual {id} parameter to be passed in. In this case I'd like the api consumer to be aware of the possible routes they can hit if they supply the paremeters specified in the uri template.\r\n"},"comment":{"url":"https://api.github.com/repos/bleupen/halacious/issues/comments/96861570","html_url":"https://github.com/bleupen/halacious/issues/55#issuecomment-96861570","issue_url":"https://api.github.com/repos/bleupen/halacious/issues/55","id":96861570,"user":{"login":"bleupen","id":3449070,"avatar_url":"https://avatars.githubusercontent.com/u/3449070?v=3","gravatar_id":"","url":"https://api.github.com/users/bleupen","html_url":"https://github.com/bleupen","followers_url":"https://api.github.com/users/bleupen/followers","following_url":"https://api.github.com/users/bleupen/following{/other_user}","gists_url":"https://api.github.com/users/bleupen/gists{/gist_id}","starred_url":"https://api.github.com/users/bleupen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bleupen/subscriptions","organizations_url":"https://api.github.com/users/bleupen/orgs","repos_url":"https://api.github.com/users/bleupen/repos","events_url":"https://api.github.com/users/bleupen/events{/privacy}","received_events_url":"https://api.github.com/users/bleupen/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T00:57:04Z","updated_at":"2015-04-28T00:57:04Z","body":"Hi there,\r\n\r\nYes, this is tougher than it should be. Lately, I have been using hapi 8 route id's to resolve a lot of my links. This has the side benefit of preserving the route's query parameters. See if this works for you (off the top of my head so there are probably syntax errors):\r\n\r\n```javascript\r\nserver.route({\r\n   path: '/api/widgets',\r\n   method: 'get',\r\n   config: {\r\n      handler: function(req, reply) {},\r\n      plugins: {\r\n          hal: {\r\n              api: 'mco:widgets',\r\n              query: '{?size,limit,q}' // will be appended to references to this route,\r\n              embedded: {\r\n                 'mco:widget': {\r\n                     path: 'items',\r\n                     href: function(rep, ctx) {\r\n                        // the route function will locate the named route, resolve parameters via the context, and append the route's query params. \r\n                        return rep.route('widget.lookup', ctx.item); \r\n                     }\r\n                 }\r\n              } \r\n          }\r\n      }\r\n   }\r\n});\r\n\r\nserver.route({\r\n   path: '/api/widgets/{id}',\r\n   method: 'get',\r\n   config: {\r\n      id: 'widget.lookup',\r\n      handler: function(req, reply) {},\r\n      plugins: {\r\n          hal: {\r\n              api: 'mco:widget',\r\n              query: '{?profile}' // will be appended to references to this route\r\n          }\r\n      }\r\n   }\r\n});\r\n```"}}