{"id":24864,"date":"2015-08-03T01:39:56","date_gmt":"2015-08-02T20:09:56","guid":{"rendered":"https:\/\/2thenew.xyz\/blog\/?p=24864"},"modified":"2015-11-19T15:34:05","modified_gmt":"2015-11-19T10:04:05","slug":"jasmine-testing-promises","status":"publish","type":"post","link":"https:\/\/2thenew.xyz\/blog\/jasmine-testing-promises\/","title":{"rendered":"Testing promises with Jasmine"},"content":{"rendered":"<p>We have been using <a title=\"Custom matcher for testing with Jasmine\" href=\"https:\/\/2thenew.xyz\/blog\/make-custom-matcher-for-testing-with-jasmine\/\">Jasmine to test our angular code<\/a>. Recently I came across a piece of code in Javascript which included a REST API call and returned a promise. The promise then had a success callback and all the rest of the play. So in this blog, I have tried to illustrate how to test a promise.<\/p>\n<p>Here I have a function which returns a promise and has a success handler and failure handler. So let&#8217;s see how to test such a function:<\/p>\n<p>[js]<\/p>\n<p>myFactory.getCallStatus = function() {<br \/>\n    MyApi.getData().$promise.then(function(data) {<br \/>\n        switch (data.status) {<br \/>\n            case &#8216;UPDATED&#8217;:<br \/>\n                myFactory.afterUpdate()<br \/>\n                break;<br \/>\n            case &#8216;COMPLETED&#8217;:<br \/>\n                myFactory.afterCompleted();<br \/>\n                break;<br \/>\n            case &#8216;FAILED&#8217;:<br \/>\n                myFactory.afterFailure()<br \/>\n                break;<br \/>\n        }<br \/>\n   });<br \/>\n}<\/p>\n<p>myFactory.afterUpdate=function(){<br \/>\n    &#8230;<br \/>\n    \/\/some code here&#8230;.<br \/>\n    &#8230;<br \/>\n}<\/p>\n<p>myFactory.afterCompleted=function(){<br \/>\n    &#8230;<br \/>\n    \/\/some code here&#8230;.<br \/>\n    &#8230;<br \/>\n}<\/p>\n<p>myFactory.afterFailure=function(){<br \/>\n    &#8230;<br \/>\n    \/\/some code here&#8230;.<br \/>\n    &#8230;<br \/>\n}<\/p>\n<p>[\/js]<\/p>\n<p>To start testing this, create a new file named &#8220;myFactory.test.js&#8221; and initialize the factory you need to test, which in this case is &#8220;MyFactory&#8221;.<\/p>\n<p>[js]<\/p>\n<p>&#8216;use strict&#8217;;<\/p>\n<p>describe(&#8216;MyFactory&#8217;, function () {<\/p>\n<p>  var factory, $q, MyApi; \/\/ declare variables to hold reference of factory and $q service.<\/p>\n<p>  beforeEach(function() {<br \/>\n    module(&#8216;someModule&#8217;); \/\/ initialized module to which your factory belongs.<br \/>\n    module(function ($provide) {<br \/>\n        \/\/ resolve all required dependencies of factory.<br \/>\n        $provide.factory(&#8216;XYZFactory&#8217;, function() {});<br \/>\n    })<\/p>\n<p>\tinject(function (_MyFactory_, _$q_, _MyApi_) {<br \/>\n       \tfactory = _MyFactory_;   \/\/ inject factory for which you are writting test cases.<br \/>\n        $q = _$q_; \t\t\t\t\/\/ As we need $q service to test function which returns promise.<br \/>\n       \tMyApi=_MyApi_;<br \/>\n    });<br \/>\n  });<\/p>\n<p>  describe(&#8216;Validate getCallStatus&#8217;, function () {<\/p>\n<p>    var deferred;<br \/>\n    var data = {&#8216;status&#8217;:&quot;UPDATED&quot;,info:&#8217;success&#8217;};<\/p>\n<p>    \/\/Mocked data to resolve getData() call of MyApi .<\/p>\n<p>   \tit(&quot;Validate getCallStatus call has been completed.&quot;,function() {<br \/>\n        deferred = $q.defer();<\/p>\n<p>        spyOn(MyApi, &#8216;getData&#8217;).and.callFake(function () {<\/p>\n<p>            \/\/Here we will don&#8217;t have mocked our getData() api call and now it returns an object of<br \/>\n           \/\/promise and it&#8217;s not been resolved.<\/p>\n<p>           return {$promise:deferred.promise, $resolve:false};<br \/>\n    \t});<\/p>\n<p>   \t\t\/\/ Now we will resolve this promise with our stubbed data.<\/p>\n<p>   \t\tdeferred.resolve(data);<br \/>\n    \texpect(MyApi.getData).toHaveBeenCalled();<br \/>\n        expect(factory.afterUpdate).toHaveBeenCalled();<br \/>\n    });<br \/>\n  });<\/p>\n<p>});<\/p>\n<p>[\/js]<\/p>\n<p>So that&#8217;s how we tested promise and it&#8217;s resolution. I hope this helps you in your testing.<\/p>\n<p>Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have been using Jasmine to test our angular code. Recently I came across a piece of code in Javascript which included a REST API call and returned a promise. The promise then had a success callback and all the rest of the play. So in this blog, I have tried to illustrate how to [&hellip;]<\/p>\n","protected":false},"author":72,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":5,"footnotes":""},"categories":[1439,7,1],"tags":[955,4840,1158,55],"class_list":["post-24864","post","type-post","status-publish","format-standard","hentry","category-angular","category-grails","category-technology","tag-angularjs","tag-grails","tag-jasmine","tag-javascript"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"We have been using Jasmine to test our angular code. Recently I came across a piece of code in Javascript which included a REST API call and returned a promise. The promise then had a success callback and all the rest of the play. So in this blog, I have tried to illustrate how to\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Komal Jain\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/2thenew.xyz\/blog\/jasmine-testing-promises\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Testing promises with Jasmine | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"We have been using Jasmine to test our angular code. Recently I came across a piece of code in Javascript which included a REST API call and returned a promise. The promise then had a success callback and all the rest of the play. So in this blog, I have tried to illustrate how to\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/2thenew.xyz\/blog\/jasmine-testing-promises\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Testing promises with Jasmine | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"We have been using Jasmine to test our angular code. Recently I came across a piece of code in Javascript which included a REST API call and returned a promise. The promise then had a success callback and all the rest of the play. So in this blog, I have tried to illustrate how to\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/jasmine-testing-promises\\\/#article\",\"name\":\"Testing promises with Jasmine | TO THE NEW Blog\",\"headline\":\"Testing promises with Jasmine\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/komal\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2015-08-03T01:39:56+05:30\",\"dateModified\":\"2015-11-19T15:34:05+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/jasmine-testing-promises\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/jasmine-testing-promises\\\/#webpage\"},\"articleSection\":\"AngularJS, Grails, Technology, AngularJS, Grails, jasmine, javascript\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/jasmine-testing-promises\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"position\":2,\"name\":\"Technology\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/jasmine-testing-promises\\\/#listItem\",\"name\":\"Testing promises with Jasmine\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/jasmine-testing-promises\\\/#listItem\",\"position\":3,\"name\":\"Testing promises with Jasmine\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/komal\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/komal\\\/\",\"name\":\"Komal Jain\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/jasmine-testing-promises\\\/#authorImage\",\"url\":\"https:\\\/\\\/newersworld-sf-static.tothenew.net\\\/prod\\\/profilePicFolder\\\/6e680a75-b4b5-46c3-b118-6780ee85a9e2_komal.jain@tothenew.com.jpg\",\"width\":96,\"height\":96,\"caption\":\"Komal Jain\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/jasmine-testing-promises\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/jasmine-testing-promises\\\/\",\"name\":\"Testing promises with Jasmine | TO THE NEW Blog\",\"description\":\"We have been using Jasmine to test our angular code. Recently I came across a piece of code in Javascript which included a REST API call and returned a promise. The promise then had a success callback and all the rest of the play. So in this blog, I have tried to illustrate how to\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/jasmine-testing-promises\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/komal\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/komal\\\/#author\"},\"datePublished\":\"2015-08-03T01:39:56+05:30\",\"dateModified\":\"2015-11-19T15:34:05+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Testing promises with Jasmine | TO THE NEW Blog","description":"We have been using Jasmine to test our angular code. Recently I came across a piece of code in Javascript which included a REST API call and returned a promise. The promise then had a success callback and all the rest of the play. So in this blog, I have tried to illustrate how to","canonical_url":"https:\/\/2thenew.xyz\/blog\/jasmine-testing-promises\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/2thenew.xyz\/blog\/jasmine-testing-promises\/#article","name":"Testing promises with Jasmine | TO THE NEW Blog","headline":"Testing promises with Jasmine","author":{"@id":"https:\/\/2thenew.xyz\/blog\/author\/komal\/#author"},"publisher":{"@id":"https:\/\/2thenew.xyz\/blog\/#organization"},"datePublished":"2015-08-03T01:39:56+05:30","dateModified":"2015-11-19T15:34:05+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/2thenew.xyz\/blog\/jasmine-testing-promises\/#webpage"},"isPartOf":{"@id":"https:\/\/2thenew.xyz\/blog\/jasmine-testing-promises\/#webpage"},"articleSection":"AngularJS, Grails, Technology, AngularJS, Grails, jasmine, javascript"},{"@type":"BreadcrumbList","@id":"https:\/\/2thenew.xyz\/blog\/jasmine-testing-promises\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog#listItem","position":1,"name":"Home","item":"https:\/\/2thenew.xyz\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/category\/technology\/#listItem","name":"Technology"}},{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/category\/technology\/#listItem","position":2,"name":"Technology","item":"https:\/\/2thenew.xyz\/blog\/category\/technology\/","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/jasmine-testing-promises\/#listItem","name":"Testing promises with Jasmine"},"previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/jasmine-testing-promises\/#listItem","position":3,"name":"Testing promises with Jasmine","previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/category\/technology\/#listItem","name":"Technology"}}]},{"@type":"Organization","@id":"https:\/\/2thenew.xyz\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/2thenew.xyz\/blog\/"},{"@type":"Person","@id":"https:\/\/2thenew.xyz\/blog\/author\/komal\/#author","url":"https:\/\/2thenew.xyz\/blog\/author\/komal\/","name":"Komal Jain","image":{"@type":"ImageObject","@id":"https:\/\/2thenew.xyz\/blog\/jasmine-testing-promises\/#authorImage","url":"https:\/\/newersworld-sf-static.tothenew.net\/prod\/profilePicFolder\/6e680a75-b4b5-46c3-b118-6780ee85a9e2_komal.jain@tothenew.com.jpg","width":96,"height":96,"caption":"Komal Jain"}},{"@type":"WebPage","@id":"https:\/\/2thenew.xyz\/blog\/jasmine-testing-promises\/#webpage","url":"https:\/\/2thenew.xyz\/blog\/jasmine-testing-promises\/","name":"Testing promises with Jasmine | TO THE NEW Blog","description":"We have been using Jasmine to test our angular code. Recently I came across a piece of code in Javascript which included a REST API call and returned a promise. The promise then had a success callback and all the rest of the play. So in this blog, I have tried to illustrate how to","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/2thenew.xyz\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/2thenew.xyz\/blog\/jasmine-testing-promises\/#breadcrumblist"},"author":{"@id":"https:\/\/2thenew.xyz\/blog\/author\/komal\/#author"},"creator":{"@id":"https:\/\/2thenew.xyz\/blog\/author\/komal\/#author"},"datePublished":"2015-08-03T01:39:56+05:30","dateModified":"2015-11-19T15:34:05+05:30"},{"@type":"WebSite","@id":"https:\/\/2thenew.xyz\/blog\/#website","url":"https:\/\/2thenew.xyz\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/2thenew.xyz\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Testing promises with Jasmine | TO THE NEW Blog","og:description":"We have been using Jasmine to test our angular code. Recently I came across a piece of code in Javascript which included a REST API call and returned a promise. The promise then had a success callback and all the rest of the play. So in this blog, I have tried to illustrate how to","og:url":"https:\/\/2thenew.xyz\/blog\/jasmine-testing-promises\/","og:image":"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Testing promises with Jasmine | TO THE NEW Blog","twitter:description":"We have been using Jasmine to test our angular code. Recently I came across a piece of code in Javascript which included a REST API call and returned a promise. The promise then had a success callback and all the rest of the play. So in this blog, I have tried to illustrate how to","twitter:image":"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"24864","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":"","og_description":"","og_object_type":"blog","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":"","og_article_tags":"","twitter_use_og":false,"twitter_card":"summary","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-29 13:19:40","updated":"2024-02-29 08:44:21","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.xyz\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.xyz\/blog\/category\/technology\/\" title=\"Technology\">Technology<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tTesting promises with Jasmine\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/2thenew.xyz\/blog"},{"label":"Technology","link":"https:\/\/2thenew.xyz\/blog\/category\/technology\/"},{"label":"Testing promises with Jasmine","link":"https:\/\/2thenew.xyz\/blog\/jasmine-testing-promises\/"}],"_links":{"self":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/posts\/24864","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/users\/72"}],"replies":[{"embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/comments?post=24864"}],"version-history":[{"count":0,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/posts\/24864\/revisions"}],"wp:attachment":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/media?parent=24864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/categories?post=24864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/tags?post=24864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}