{"id":995,"date":"2020-09-03T11:10:00","date_gmt":"2020-09-03T09:10:00","guid":{"rendered":"http:\/\/cmagazine.test\/graphql-testing-with-karate\/"},"modified":"2020-11-09T11:12:42","modified_gmt":"2020-11-09T10:12:42","slug":"graphql-testing-karate","status":"publish","type":"post","link":"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/","title":{"rendered":"GraphQL Testing With Karate"},"content":{"rendered":"\t\t\t\t<div class=\"wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-1544201c      \"\n\t\t\t\t\tdata-scroll= \"1\"\n\t\t\t\t\tdata-offset= \"30\"\n\t\t\t\t\tstyle=\"\"\n\t\t\t\t>\n\t\t\t\t<div class=\"uagb-toc__wrap\">\n\t\t\t\t\t\t<div class=\"uagb-toc__title\">\n\t\t\t\t\t\t\tTable Of Contents\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"uagb-toc__list-wrap \">\n\t\t\t\t\t\t<ol class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#what-is-graphql\" class=\"uagb-toc-link__trigger\">What is GraphQL?<\/a><ul class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#overcoming-over-fetching\" class=\"uagb-toc-link__trigger\">Overcoming over-fetching<\/a><li class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#graphql-syntax\" class=\"uagb-toc-link__trigger\">GraphQL Syntax<\/a><\/li><\/ul><\/li><li class=\"uagb-toc__list\"><a href=\"#testing-graphql-services-with-karate\" class=\"uagb-toc-link__trigger\">Testing GraphQL services with Karate<\/a><ul class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#manage-the-plain-text-query\" class=\"uagb-toc-link__trigger\">Manage the plain text query<\/a><li class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#manage-the-json-response\" class=\"uagb-toc-link__trigger\">Manage the JSON response<\/a><\/li><\/ul><\/li><\/ul><\/li><li class=\"uagb-toc__list\"><a href=\"#concluding-remarks\" class=\"uagb-toc-link__trigger\">Concluding remarks<\/a><li class=\"uagb-toc__list\"><a href=\"#want-to-launch-a-developer-event-despite-the-challenges-of-covid-19\" class=\"uagb-toc-link__trigger\">Want to launch a developer event despite the challenges of  COVID-19?<\/a><\/ul><\/ul><\/ol>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\n\n\n<p class=\"eplus-UhSFIH\"><b style=\"user-select: auto;\">Web <span style=\"user-select: auto;\" id=\"urn:enhancement-3e6a001b\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/application_programming_interface\">APIs<\/span><\/b> have become one of the most common solutions for providing services and <span style=\"user-select: auto;\" id=\"urn:enhancement-8541ae50\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/data\">data<\/span> to very heterogeneous <span style=\"user-select: auto;\" id=\"urn:enhancement-500257ba\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/client_computing\">clients<\/span>, especially from the era of <span style=\"user-select: auto;\" id=\"urn:enhancement-618f3890\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/web_2-0\">Web 2<\/span>.0, with the widespread of mobile technologies. <\/p>\n\n\n\n<p class=\"eplus-XoY4SN\">In this context, it is no surprise that architectural models such as <a href=\"https:\/\/www.codemotion.com\/magazine\/tag\/rest\/\"><b style=\"user-select: auto;\"><span style=\"user-select: auto;\" id=\"urn:enhancement-a2e9f697\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/representational_state_transfer\">REST<\/span><\/b>-based <span style=\"user-select: auto;\" id=\"urn:enhancement-bf9a9bbb\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/application_programming_interface\">APIs<\/span><\/a> have reached the peak in terms of uses. Although <span style=\"user-select: auto;\" id=\"urn:enhancement-2c4fe6e8\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/representational_state_transfer\">REST<\/span> has the advantage of being a simple paradigm, easily adaptable to many different situations, it is often misused by some developers, who consider any kind of web <span style=\"user-select: auto;\" id=\"urn:enhancement-196f0b34\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/application_programming_interface\">API<\/span> as an implementation of the <span style=\"user-select: auto;\" id=\"urn:enhancement-4daf379b\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/representational_state_transfer\">REST<\/span> principles. <\/p>\n\n\n\n<p class=\"eplus-BNAxpi\">Moreover, <span style=\"user-select: auto;\" id=\"urn:enhancement-d9955fde\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/representational_state_transfer\">REST<\/span> has also been proven as not being the most effective solution when looking at <span style=\"user-select: auto;\" id=\"urn:enhancement-57c16886\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/hypertext_transfer_protocol\">HTTP request<\/span> numbers and the amount of <span style=\"user-select: auto;\" id=\"urn:enhancement-a8bcc03e\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/data\">data<\/span> required by the <span style=\"user-select: auto;\" id=\"urn:enhancement-ddf0d227\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/client_computing\">clients<\/span>.<\/p>\n\n\n\n<p class=\"eplus-aM6uN8\">In order to solve some of the limitations of the <span id=\"urn:enhancement-3978badb\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/representational_state_transfer\">REST<\/span> paradigm, <span id=\"urn:enhancement-af5b15b0\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/facebook\">Facebook<\/span> developed <b>GraphQL<\/b>, a query and manipulation language specifically designed for being used for interfacing with <span id=\"urn:enhancement-ac591c02\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/web_service\">web services<\/span>. In this article, we will provide a quick overview of GraphQL and explain how it differs from the more traditional <span id=\"urn:enhancement-a13abee0\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/representational_state_transfer\">REST<\/span> model.<\/p>\n\n\n\n<p class=\"eplus-9hZcp3\">Before starting with the article, if you are interested in these themes don&#8217;t miss the opportunity to attend the upcoming <strong style=\"user-select: auto;\"><a style=\"user-select: auto;\" href=\"https:\/\/www.codemotion.com\/magazine\/?p=8618\" target=\"_blank\" rel=\"noreferrer noopener\">Codemotion Online Tech Conference<\/a><\/strong> on October 2020! Among the other talks, you&#8217;ll have the opportunity to attend the one by <a aria-label=\"undefined (opens in a new tab)\" style=\"user-select: auto;\" href=\"https:\/\/twitter.com\/urigoldshtein\" target=\"_blank\" rel=\"noreferrer noopener\">Uri Goldshtein<\/a>, titled &#8220;Adopt GraphQL without Writing any Backend Code&#8221;. Check the agenda <a style=\"user-select: auto;\" href=\"https:\/\/events.codemotion.com\/conferences\/online\/2020\/codemotion-online-tech-conference\/\">here<\/a>: free tickets are still available!<\/p>\n\n\n\n<p class=\"eplus-ksTehn\">And, if you want to know more about how modern technologies and tools can support you for &#8211; and during &#8211; the organisation of a virtual event, don&#8217;t miss this article showcasing the best tools we used to <a style=\"user-select: auto;\" href=\"https:\/\/www.codemotion.com\/magazine\/articles\/events\/planning-virtual-conference\/\">host our online conferences<\/a> since the COVID-19 outbreak.<\/p>\n\n\n\n<h2 class=\"eplus-Fxh5O7 wp-block-heading\" id=\"h-what-is-graphql\">What is GraphQL?<\/h2>\n\n\n\n<p class=\"eplus-DmOR9b\">GraphQL is not really new, although it&#8217;s a quite trending topic now. Not surprisingly, in Codemotion Rome 2019 we already had the pleasure of discussing about this technology with <strong>Luca Pelosi<\/strong> and <strong>Angela Distratis<\/strong> (both employed at Hotels.com). They provided a really nice  overview on <strong>how to test GraphQL<\/strong> by exploiting the <span id=\"urn:enhancement-48fe2e37\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/feature_machine_learning\">features<\/span> provided by <b>Karate<\/b>, an <span id=\"urn:enhancement-a1e51c98\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/open_source\">open source<\/span> tool for <b><a href=\"https:\/\/www.codemotion.com\/magazine\/tag\/testing\/\"><span id=\"urn:enhancement-e971359c\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/application_programming_interface\">API<\/span> test automation<\/a><\/b>. In the following we will use some of the most interesting hints from their talk.<\/p>\n\n\n\n<div class=\"wp-block-image eplus-rhV2Ir\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/E4A3047.jpg\" alt=\"GraphQL Testing With Karate\"\/><figcaption>Luca Pelosi and Angela Distratis during their talk at Codemotion Rome 2019<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"eplus-e4nsoz\">As stated before, GraphQL is a <b><span id=\"urn:enhancement-311482d5\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/query_language\">query language<\/span><\/b> for <span id=\"urn:enhancement-706df6d1\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/application_programming_interface\">APIs<\/span>, which also includes a <b>server-side runtime<\/b> for executing queries. Many different <span id=\"urn:enhancement-e840d601\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/programming_languages\">programming languages<\/span> can be used to implement GraphQL services, which works <b>over HTTP<\/b> like any other <span id=\"urn:enhancement-a853c033\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/representational_state_transfer\">REST<\/span> service or web <span id=\"urn:enhancement-9f9ed8a7\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/application_programming_interface\">API<\/span>. However, there are some fundamental differences between GraphQL and <span id=\"urn:enhancement-16882038\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/representational_state_transfer\">REST<\/span>.<\/p>\n\n\n\n<h3 class=\"eplus-XMfVWr wp-block-heading\" id=\"h-overcoming-over-fetching\">Overcoming over-fetching<\/h3>\n\n\n\n<p class=\"eplus-cBUFus\">First, GraphQL allows us to <b>access resources with a single request<\/b>. This is crucial to avoid overheads due to multiple requests needed to get the full information required, a common issue usually referred as <b>over-fetching<\/b>.<\/p>\n\n\n\n<p class=\"eplus-66C0s7\">This problem, and how it is solved by GraphQL, is easily explained by the following example. Imagine that you need to get information about a user, her posts and her followers. With a typical <span id=\"urn:enhancement-41f86360\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/representational_state_transfer\">REST<\/span> <span id=\"urn:enhancement-9824eecf\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/application_programming_interface\">API<\/span>, you will probably need three different requests, according to the following <span id=\"urn:enhancement-835c6fd2\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_schema\">schema<\/span>:<\/p>\n\n\n\n<div class=\"wp-block-image eplus-2kyty7\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/restschema.png\" alt=\"GraphQL Testing With Karate\"\/><\/figure><\/div>\n\n\n\n<p class=\"eplus-1XMFX6\">An alternative choice based on GraphQL would have translated in a single request, as depicted by the following picture:<\/p>\n\n\n\n<div class=\"wp-block-image eplus-XkKRkK\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/graphqlexample.png\" alt=\"GraphQL Testing With Karate\"\/><\/figure><\/div>\n\n\n\n<h3 class=\"eplus-UiFMCZ wp-block-heading\" id=\"h-graphql-syntax\">GraphQL Syntax<\/h3>\n\n\n\n<p class=\"eplus-X4q5H5\">The previous image also shows the main difference between <span id=\"urn:enhancement-c351b2d3\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/representational_state_transfer\">REST<\/span> and GraphQL, which is in the <span id=\"urn:enhancement-6c5b9bac\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/syntax\">syntax<\/span>. While <span id=\"urn:enhancement-2415e64e\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/representational_state_transfer\">REST<\/span> is totally based on <span id=\"urn:enhancement-564a51a4\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/hypertext_transfer_protocol\">HTTP<\/span> methods, any GraphQL request can be based on a <span id=\"urn:enhancement-1e721ca4\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/hypertext_transfer_protocol\">HTTP<\/span> <span id=\"urn:enhancement-47627f75\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/post_http\">POST<\/span> request that includes a <b>plain text query<\/b>, written according to the <span id=\"urn:enhancement-c98a10c0\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/query_language\">query language<\/span> rules. The GraphQL service then replies with a <b><span id=\"urn:enhancement-624316d1\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/json\">JSON<\/span> response<\/b>, which includes all the required information.<\/p>\n\n\n\n<h2 class=\"eplus-9iUjEr wp-block-heading\" id=\"h-testing-graphql-services-with-karate\">Testing GraphQL services with Karate<\/h2>\n\n\n\n<p class=\"eplus-SKafyW\">While the previous overview is very concise, it helps in understanding how GraphQL services work. However, it is also important to test them and possibly automatise such tests. To this end, Pelosi and Distratis described the main <span id=\"urn:enhancement-3415829e\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/feature_machine_learning\">features<\/span> of <b>Karate<\/b>, a very interesting <span id=\"urn:enhancement-44a2755\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/open_source\">open source<\/span> tool for <b>test automation<\/b>, which can be easily adapted to GraphQL.<\/p>\n\n\n\n<p class=\"eplus-scwufh\">Karate uses the same <span id=\"urn:enhancement-80a4cca1\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/syntax\">syntax<\/span> used for cucumber specification, which is <b>Gherkin<\/b>. It represents an extremely simplified way to describe tests, without going into many implementation details.<\/p>\n\n\n\n<p class=\"eplus-2x9p43\">The following example shows how to create a simple test for a <span id=\"urn:enhancement-4d6f0b22\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/representational_state_transfer\">REST<\/span> <span id=\"urn:enhancement-e3629c19\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/application_programming_interface\">API<\/span>.<\/p>\n\n\n\n<div class=\"wp-block-image eplus-FpQSiT\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/graphqlplaintext.png\" alt=\"GraphQL Testing With Karate\"\/><\/figure><\/div>\n\n\n\n<p class=\"eplus-SP1JQZ\">Here we can see some interesting <span id=\"urn:enhancement-97c905ff\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/feature_machine_learning\">features<\/span> of Gherkin <span id=\"urn:enhancement-92be94a5\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/syntax\">syntax<\/span> and thus Karate. First, it natively supports <span id=\"urn:enhancement-ad1e23ca\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/json\">JSON<\/span>, as shown when specify the <i>request<\/i> parameters. Second, it is possible to perform payload assertions with a single line, basically thanks to the <code><i>==<\/i><\/code> operator.<\/p>\n\n\n\n<p class=\"eplus-AhouI1\">Using Karate for automating GraphQL tests is thus an interesting option. In the following, we will analyse some of the examples proposed by Pelosi and Distratis during their talk.<\/p>\n\n\n\n<h3 class=\"eplus-q8Oe0K wp-block-heading\" id=\"h-manage-the-plain-text-query\">Manage the plain text query<\/h3>\n\n\n\n<div class=\"wp-block-image eplus-1G6pS8\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/gherkinrest.png\" alt=\"GraphQL Testing With Karate\" width=\"543\" height=\"334\"\/><\/figure><\/div>\n\n\n\n<p class=\"eplus-eA6RtZ\">In this first example, we can see some interesting <span style=\"user-select: auto;\" id=\"urn:enhancement-bb313c03\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/feature_machine_learning\">features<\/span> of Karate. The first interesting thing is the <i style=\"user-select: auto;\">read<\/i> <span style=\"user-select: auto;\" id=\"urn:enhancement-e69c56bf\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/subroutine\">function<\/span>, which allows us to <b style=\"user-select: auto;\">read from <span style=\"user-select: auto;\" id=\"urn:enhancement-5e6734ca\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/computer_file\">files<\/span><\/b>. <\/p>\n\n\n\n<p class=\"eplus-93Ugef\">In line 3, we are reading a query <span style=\"user-select: auto;\" id=\"urn:enhancement-746b6175\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/computer_file\">file<\/span>, saving it in a plain text <span style=\"user-select: auto;\" id=\"urn:enhancement-dcc0278f\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/variable_computer_science\">variable<\/span> named <i style=\"user-select: auto;\">query<\/i>. the next line is even more interesting: we can <b style=\"user-select: auto;\">read a <span style=\"user-select: auto;\" id=\"urn:enhancement-157999c3\" class=\"textannotation disambiguated wl-creative-work\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/javascript\">JavaScript<\/span> <span style=\"user-select: auto;\" id=\"urn:enhancement-ac983f1b\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/subroutine\">function<\/span><\/b> from <span style=\"user-select: auto;\" id=\"urn:enhancement-415cd998\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/computer_file\">file<\/span> (line 4) and then use it in order to <span style=\"user-select: auto;\" id=\"urn:enhancement-580a7a8e\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/process_computing\">process<\/span> our previously loaded text query (line 5). Line 10 shows us how to <b style=\"user-select: auto;\">build a request<\/b>, with the syntax required to include previously defined <span style=\"user-select: auto;\" id=\"urn:enhancement-c03747fd\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/variable_computer_science\">variables<\/span> inside a <span style=\"user-select: auto;\" id=\"urn:enhancement-1830caf9\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/json\">JSON<\/span> object.<\/p>\n\n\n\n<h3 class=\"eplus-6XikUc wp-block-heading\" id=\"h-manage-the-json-response\">Manage the JSON response<\/h3>\n\n\n\n<p class=\"eplus-RXqN4D\">In order to verify the <span id=\"urn:enhancement-a51cdad8\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/json\">JSON<\/span> response, we can rely on the <i>match<\/i> <span id=\"urn:enhancement-1981964\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/statement_computer_science\">statement<\/span>.<\/p>\n\n\n\n<div class=\"wp-block-image eplus-ysCNnF\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/match.png\" alt=\"GraphQL Testing With Karate\" width=\"658\" height=\"240\"\/><\/figure><\/div>\n\n\n\n<p class=\"eplus-ikZWCO\">It is important to <span id=\"urn:enhancement-56dc44f0\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/syntax_highlighting\">highlight<\/span> that white spaces are automatically stripped and also the order of the elements is automatically managed, being not relevant for the matching.<\/p>\n\n\n\n<p class=\"eplus-Z3ooQh\">Karate also allows us to use <b>regular <span id=\"urn:enhancement-37f7ae8e\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/expression_computer_science\">expressions<\/span><\/b> in order to verify the response content. The following shows us how to check if a property inside a <span id=\"urn:enhancement-6a5cf52d\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/json\">JSON<\/span> object (which for the sake of simplicity is defined and stored within a <span id=\"urn:enhancement-34cb3da7\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/variable_computer_science\">variable<\/span>) is properly formatted (i.e. contains only 3 uppercase <span id=\"urn:enhancement-9e6bb58a\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/character_computing\">characters<\/span>):<\/p>\n\n\n\n<figure class=\"wp-block-image size-large eplus-Iir78K\"><img decoding=\"async\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/regex.png\" alt=\"GraphQL Testing With Karate\"\/><\/figure>\n\n\n\n<h2 class=\"eplus-Pql65Y wp-block-heading\" id=\"h-concluding-remarks\">Concluding remarks<\/h2>\n\n\n\n<p class=\"eplus-yQwGEv\">Karate is an interesting tool to try if you are planning to build and maintain GraphQL services. What we have discussed in this article is just an appetizer of the whole potential provided by Karate.<\/p>\n\n\n\n<p class=\"eplus-yVjwnc\">For instance, it also allows us to produce automatic reports, provides mock support and includes a <span style=\"user-select: auto;\" id=\"urn:enhancement-df7b3572\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/graphical_user_interface\">graphical user interface<\/span> to ease its usage.<\/p>\n\n\n\n<p class=\"eplus-H7vuFp\">As already mentioned, Karate is <span style=\"user-select: auto;\" id=\"urn:enhancement-47794417\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/open_source\">open source<\/span>. You can get this tool from <a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/github.com\/intuit\/karate\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a>, where you will find a proper <b style=\"user-select: auto;\">documentation<\/b>, including tutorials and additional examples.<\/p>\n\n\n\n<h2 class=\"eplus-viWvHk wp-block-heading\" id=\"h-want-to-launch-a-developer-event-despite-the-challenges-of-covid-19\">Want to launch a developer event despite the challenges of  COVID-19?<\/h2>\n\n\n\n<p class=\"eplus-Dlirgv\">If you want to know more about how modern technologies and tools can support you for \u2013 and during \u2013 the organisation of a virtual event, don\u2019t miss this article showcasing the best tools we used to&nbsp;<a style=\"user-select: auto;\" href=\"https:\/\/www.codemotion.com\/magazine\/articles\/events\/hosting-virtual-conference\/\">host our online conferences<\/a>&nbsp;since the COVID-19 outbreak.<\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>Web APIs have become one of the most common solutions for providing services and data to very heterogeneous clients, especially from the era of Web 2.0, with the widespread of mobile technologies. In this context, it is no surprise that architectural models such as REST-based APIs have reached the peak in terms of uses. Although&#8230; <a class=\"more-link\" href=\"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/\">Read more<\/a><\/p>\n","protected":false},"author":3,"featured_media":8540,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":5,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","_uag_custom_page_level_css":"","_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[31],"tags":[7192,4,67,3359,4359],"collections":[],"class_list":{"0":"post-995","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-web-developer","8":"tag-api","9":"tag-codemotion-rome","10":"tag-graphql","11":"tag-rest","12":"tag-testing","13":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>GraphQL Testing With Karate - Codemotion Magazine<\/title>\n<meta name=\"description\" content=\"An overview about GraphQL, the differences with REST API, and how to test it with Karate, an open source tool for API test automation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GraphQL Testing With Karate\" \/>\n<meta property=\"og:description\" content=\"An overview about GraphQL, the differences with REST API, and how to test it with Karate, an open source tool for API test automation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/\" \/>\n<meta property=\"og:site_name\" content=\"Codemotion Magazine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Codemotion.Italy\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-03T09:10:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-09T10:12:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1013\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Vito Gentile\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ViGentile\" \/>\n<meta name=\"twitter:site\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vito Gentile\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/\"},\"author\":{\"name\":\"Vito Gentile\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/f9c99d8dfb99900d709bb8199225d313\"},\"headline\":\"GraphQL Testing With Karate\",\"datePublished\":\"2020-09-03T09:10:00+00:00\",\"dateModified\":\"2020-11-09T10:12:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/\"},\"wordCount\":1132,\"publisher\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1.jpg\",\"keywords\":[\"API\",\"Codemotion Rome\",\"GraphQL\",\"REST\",\"Testing\"],\"articleSection\":[\"Web Developer\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/\",\"name\":\"GraphQL Testing With Karate - Codemotion Magazine\",\"isPartOf\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1.jpg\",\"datePublished\":\"2020-09-03T09:10:00+00:00\",\"dateModified\":\"2020-11-09T10:12:42+00:00\",\"description\":\"An overview about GraphQL, the differences with REST API, and how to test it with Karate, an open source tool for API test automation.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/#primaryimage\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1.jpg\",\"contentUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1.jpg\",\"width\":1013,\"height\":675},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Frontend\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/frontend\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Web Developer\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"GraphQL Testing With Karate\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#website\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/\",\"name\":\"Codemotion Magazine\",\"description\":\"We code the future. Together\",\"publisher\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\",\"name\":\"Codemotion\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png\",\"contentUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png\",\"width\":225,\"height\":225,\"caption\":\"Codemotion\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Codemotion.Italy\/\",\"https:\/\/x.com\/CodemotionIT\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/f9c99d8dfb99900d709bb8199225d313\",\"name\":\"Vito Gentile\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ebcb5b885a4f1669578d08a55deb81064893c07c1b35b7b36eb059cce730ae90?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ebcb5b885a4f1669578d08a55deb81064893c07c1b35b7b36eb059cce730ae90?s=96&d=mm&r=g\",\"caption\":\"Vito Gentile\"},\"description\":\"I\u2019m a data scientist, tech writer, software developer with experience in mobile, web (full-stack) and Python programming, and former researcher with interests in human-computer interaction. I thus have a multi-faceted experience in the area of software development, and that\u2019s why I love my job(s)!\",\"sameAs\":[\"https:\/\/vitogentile.it\",\"https:\/\/www.linkedin.com\/in\/vitogentile\/en\",\"https:\/\/x.com\/ViGentile\"],\"url\":\"https:\/\/www.codemotion.com\/magazine\/author\/vito-gentile\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"GraphQL Testing With Karate - Codemotion Magazine","description":"An overview about GraphQL, the differences with REST API, and how to test it with Karate, an open source tool for API test automation.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/","og_locale":"en_US","og_type":"article","og_title":"GraphQL Testing With Karate","og_description":"An overview about GraphQL, the differences with REST API, and how to test it with Karate, an open source tool for API test automation.","og_url":"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/","og_site_name":"Codemotion Magazine","article_publisher":"https:\/\/www.facebook.com\/Codemotion.Italy\/","article_published_time":"2020-09-03T09:10:00+00:00","article_modified_time":"2020-11-09T10:12:42+00:00","og_image":[{"width":1013,"height":675,"url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1.jpg","type":"image\/jpeg"}],"author":"Vito Gentile","twitter_card":"summary_large_image","twitter_creator":"@ViGentile","twitter_site":"@CodemotionIT","twitter_misc":{"Written by":"Vito Gentile","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/#article","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/"},"author":{"name":"Vito Gentile","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/f9c99d8dfb99900d709bb8199225d313"},"headline":"GraphQL Testing With Karate","datePublished":"2020-09-03T09:10:00+00:00","dateModified":"2020-11-09T10:12:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/"},"wordCount":1132,"publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1.jpg","keywords":["API","Codemotion Rome","GraphQL","REST","Testing"],"articleSection":["Web Developer"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/","url":"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/","name":"GraphQL Testing With Karate - Codemotion Magazine","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/#primaryimage"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1.jpg","datePublished":"2020-09-03T09:10:00+00:00","dateModified":"2020-11-09T10:12:42+00:00","description":"An overview about GraphQL, the differences with REST API, and how to test it with Karate, an open source tool for API test automation.","breadcrumb":{"@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/#primaryimage","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1.jpg","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1.jpg","width":1013,"height":675},{"@type":"BreadcrumbList","@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/graphql-testing-karate\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codemotion.com\/magazine\/"},{"@type":"ListItem","position":2,"name":"Frontend","item":"https:\/\/www.codemotion.com\/magazine\/frontend\/"},{"@type":"ListItem","position":3,"name":"Web Developer","item":"https:\/\/www.codemotion.com\/magazine\/frontend\/web-developer\/"},{"@type":"ListItem","position":4,"name":"GraphQL Testing With Karate"}]},{"@type":"WebSite","@id":"https:\/\/www.codemotion.com\/magazine\/#website","url":"https:\/\/www.codemotion.com\/magazine\/","name":"Codemotion Magazine","description":"We code the future. Together","publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codemotion.com\/magazine\/#organization","name":"Codemotion","url":"https:\/\/www.codemotion.com\/magazine\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","width":225,"height":225,"caption":"Codemotion"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Codemotion.Italy\/","https:\/\/x.com\/CodemotionIT"]},{"@type":"Person","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/f9c99d8dfb99900d709bb8199225d313","name":"Vito Gentile","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ebcb5b885a4f1669578d08a55deb81064893c07c1b35b7b36eb059cce730ae90?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ebcb5b885a4f1669578d08a55deb81064893c07c1b35b7b36eb059cce730ae90?s=96&d=mm&r=g","caption":"Vito Gentile"},"description":"I\u2019m a data scientist, tech writer, software developer with experience in mobile, web (full-stack) and Python programming, and former researcher with interests in human-computer interaction. I thus have a multi-faceted experience in the area of software development, and that\u2019s why I love my job(s)!","sameAs":["https:\/\/vitogentile.it","https:\/\/www.linkedin.com\/in\/vitogentile\/en","https:\/\/x.com\/ViGentile"],"url":"https:\/\/www.codemotion.com\/magazine\/author\/vito-gentile\/"}]}},"featured_image_src":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1-600x400.jpg","featured_image_src_square":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1-600x600.jpg","author_info":{"display_name":"Vito Gentile","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/vito-gentile\/"},"uagb_featured_image_src":{"full":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1.jpg",1013,675,false],"thumbnail":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1-150x150.jpg",150,150,true],"medium":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1-300x200.jpg",300,200,true],"medium_large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1-768x512.jpg",768,512,true],"large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1.jpg",1013,675,false],"1536x1536":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1.jpg",1013,675,false],"2048x2048":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1.jpg",1013,675,false],"small-home-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1.jpg",100,67,false],"sidebar-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1-180x128.jpg",180,128,true],"genesis-singular-images":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1-896x504.jpg",896,504,true],"archive-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1-400x225.jpg",400,225,true],"gb-block-post-grid-landscape":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1-600x400.jpg",600,400,true],"gb-block-post-grid-square":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/09\/PIXNIO-205867-3087x2058-1-600x600.jpg",600,600,true]},"uagb_author_info":{"display_name":"Vito Gentile","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/vito-gentile\/"},"uagb_comment_info":0,"uagb_excerpt":"Web APIs have become one of the most common solutions for providing services and data to very heterogeneous clients, especially from the era of Web 2.0, with the widespread of mobile technologies. In this context, it is no surprise that architectural models such as REST-based APIs have reached the peak in terms of uses. Although&#8230;&hellip;","lang":"en","_links":{"self":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/995","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/comments?post=995"}],"version-history":[{"count":17,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/995\/revisions"}],"predecessor-version":[{"id":12029,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/995\/revisions\/12029"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media\/8540"}],"wp:attachment":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media?parent=995"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/categories?post=995"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/tags?post=995"},{"taxonomy":"collections","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/collections?post=995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}