{"id":20563,"date":"2014-01-13T16:00:19","date_gmt":"2014-01-13T14:00:19","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=20563"},"modified":"2014-01-12T21:58:45","modified_gmt":"2014-01-12T19:58:45","slug":"check-your-rest-parameters","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html","title":{"rendered":"Check your REST parameters!"},"content":{"rendered":"<p>I was doing research related to my ongoing \u201cproject student\u201d series and realized that I had made one of the most common \u2013 and most easily remedied \u2013 mistakes. I wasn\u2019t using everything I know about the webapp to push my security perimeter outwards.<\/p>\n<p>I am thinking specifically about the UUID parameters. I know that every valid externally visible ID will be a UUID. I know the form of the UUIDs. So why don\u2019t I verify that my \u201cuuid\u201d parameters are potentially valid UUIDs before going any further?<\/p>\n<p>It\u2019s true that the database layer won\u2019t recognize a bad \u201cuuid\u201d value \u2013 but that may not be the intent of the attacker. Perhaps it\u2019s part of a SQL injection attack. Perhaps it\u2019s part of an XSS attack. Perhaps it\u2019s part of an attack on my logs (e.g., by including a really long value that might cause a buffer overflow). Perhaps it\u2019s part of something I\u2019ve never heard of. It doesn\u2019t matter \u2013 I will <strong>always<\/strong> be stronger by eliminating known-invalid data as quickly as possible.<\/p>\n<h2>Utility Method<\/h2>\n<p>The utility method to determine whether a value is a possible UUID uses a simple regex pattern.<\/p>\n<pre class=\" brush:java\">public final class StudentUtil {\r\n    private static final Pattern UUID_PATTERN = Pattern\r\n            .compile(\"^\\\\p{XDigit}{8}+-\\\\p{XDigit}{4}+-\\\\p{XDigit}{4}-\\\\p{XDigit}{4}+-\\\\p{XDigit}{12}$\");\r\n\r\n    \/**\r\n     * Private constructor to prevent instantiation.\r\n     *\/\r\n    private StudentUtil() {\r\n\r\n    }\r\n\r\n    public static boolean isPossibleUuid(String value) {\r\n        return value != null &amp;&amp; UUID_PATTERN.matcher(value).matches();\r\n    }\r\n}<\/pre>\n<p>If we want to be aggressive we could carefully select our UUIDs so they have additional properties that we can check. For instance the corresponding BigInteger could always have a remainder of 3 mod 17. It\u2019s unlikely an attack would know this and we would have warning when somebody is probing our system. An even more sophisticated approach would use a different property for each class of UUID, e.g., a \u2018course\u2019 UUID might be 3 mod 17 while a \u2018student\u2019 UUID is 5 mod 17.<\/p>\n<h2>Unit Test<\/h2>\n<p>It\u2019s easy to go overboard on our tests but a minimal set would be checking for non-hex digits,<br \/>\ntoo many or too few values, an empty string, and a null value.<\/p>\n<pre class=\" brush:java\">public class StudentUtilTest {\r\n\r\n    @Test\r\n    public void testValidUuid() {\r\n        assertTrue(StudentUtil.isPossibleUuid(\"63c7d688-705c-4374-937c-6628952b41e1\"));\r\n    }\r\n\r\n    @Test\r\n    public void testInvalidUuid() {\r\n        assertTrue(!StudentUtil.isPossibleUuid(\"63c7d68x-705c-4374-937c-6628952b41e1\"));\r\n        assertTrue(!StudentUtil.isPossibleUuid(\"63c7d68-8705c-4374-937c-6628952b41e1\"));\r\n        assertTrue(!StudentUtil.isPossibleUuid(\"63c7d688-705c4-374-937c-6628952b41e1\"));\r\n        assertTrue(!StudentUtil.isPossibleUuid(\"63c7d688-705c-43749-37c-6628952b41e1\"));\r\n        assertTrue(!StudentUtil.isPossibleUuid(\"63c7d688-705c-4374-937c6-628952b41e1\"));\r\n        assertTrue(!StudentUtil.isPossibleUuid(\"63c7d688-705c-4374-937c-6628952b41e1a\"));\r\n        assertTrue(!StudentUtil.isPossibleUuid(\"63c7d688-705c-4374-937c-6628952b41e\"));\r\n        assertTrue(!StudentUtil.isPossibleUuid(\"\"));\r\n        assertTrue(!StudentUtil.isPossibleUuid(null));\r\n    }\r\n}<\/pre>\n<h2>REST Server<\/h2>\n<p>The REST server should check the UUID value for all methods that require one. It\u2019s safe to log the request parameter after we\u2019ve verified it\u2019s a well-formed UUID but still need to be careful about logging unsanitized values in the request.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\" brush:java\">@Path(\"\/{courseId}\")\r\n    @GET\r\n    @Produces({ MediaType.APPLICATION_JSON, MediaType.TEXT_XML })\r\n    public Response getCourse(@PathParam(\"courseId\") String id) {\r\n\r\n        Response response = null;\r\n        if (!StudentUtil.isPossibleUuid(id)) {\r\n            response = Response.status(Status.BAD_REQUEST).build();\r\n            LOG.info(\"attempt to use malformed UUID\");\r\n        } else {\r\n            LOG.debug(\"CourseResource: getCourse(\" + id + \")\");\r\n            try {\r\n                Course course = finder.findCourseByUuid(id);\r\n                response = Response.ok(scrubCourse(course)).build();\r\n            } catch (ObjectNotFoundException e) {\r\n                response = Response.status(Status.NOT_FOUND).build();\r\n                LOG.debug(\"course not found: \" + id);\r\n            } catch (Exception e) {\r\n                if (!(e instanceof UnitTestException)) {\r\n                    LOG.info(\"unhandled exception\", e);\r\n                }\r\n                response = Response.status(Status.INTERNAL_SERVER_ERROR).build();\r\n            }\r\n        }\r\n\r\n        return response;\r\n    }<\/pre>\n<p>An obvious improvement is to move this check (and the exception catchall) into an AOP wrapper to all service methods. This will simplify the code and go a long way towards guaranteeing that the checks are always performed. (I\u2019m not using it in Project Student at the moment since the webservice server layer doesn\u2019t currently have Spring dependencies.)<\/p>\n<p>You can make a strong opsec argument that the REST methods should return a NOT_FOUND response instead of a BAD_REQUEST response in order to reduce information leakage.<\/p>\n<h2>Webapps<\/h2>\n<p>The details differ but we should do the same thing with webapps even if they\u2019re just shallow front-ends to REST services. Whenever there\u2019s a UUID, no matter it\u2019s source, it should be checked before it is used.<\/p>\n<h2>Filters<\/h2>\n<p>There is a school of thought that security should be handled separately from the application \u2013 that the best security is knit in at deployment (via filters and AOP) instead of being baked into the application. Nobody is suggesting that app developers should ignore security considerations, just that checks like I discussed above are clutter that distract the developer and aren\u2019t reliable since it\u2019s easy for a developer to overlook. They would recommend using AOP or a filter instead.<\/p>\n<p>It\u2019s straightforward to write a filter that does the same work as the code above:<\/p>\n<pre class=\" brush:java\">public class RestParameterFilter implements Filter {\r\n    private static final Logger LOG = Logger.getLogger(RestParameterFilter.class);\r\n    private static final Set&lt;String&gt; validNouns = new HashSet&lt;&gt;();\r\n\r\n    \/**\r\n     * @see javax.servlet.Filter#init(javax.servlet.FilterConfig)\r\n     *\/\r\n    @Override\r\n    public void init(FilterConfig cfg) throws ServletException {\r\n\r\n        \/\/ learn valid nouns\r\n        final String nouns = cfg.getInitParameter(\"valid-nouns\");\r\n        if (nouns != null) {\r\n            for (String noun : nouns.split(\",\")) {\r\n                validNouns.add(noun.trim());\r\n            }\r\n        }\r\n    }\r\n\r\n    \/**\r\n     * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest,\r\n     *      javax.servlet.ServletResponse, javax.servlet.FilterChain)\r\n     *\/\r\n    @Override\r\n    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException,\r\n            ServletException {\r\n\r\n        HttpServletRequest hreq = (HttpServletRequest) req;\r\n        HttpServletResponse hresp = (HttpServletResponse) resp;\r\n\r\n        \/\/ verify the noun + uuid\r\n        if (!checkPathInfo(hreq, hresp)) {\r\n            return;\r\n        }\r\n\r\n        \/\/ do additional tests, e.g., inspect payload\r\n\r\n        chain.doFilter(req, resp);\r\n    }\r\n\r\n    \/**\r\n     * @see javax.servlet.Filter#destroy()\r\n     *\/\r\n    @Override\r\n    public void destroy() {\r\n    }\r\n\r\n    \/**\r\n     * Check the pathInfo. We know that all paths should have the form\r\n     * \/{noun}\/{uuid}\/...\r\n     * \r\n     * @param req\r\n     * @return\r\n     *\/\r\n    public boolean checkPathInfo(HttpServletRequest req, HttpServletResponse resp) {\r\n        \/\/ this pattern only handles noun and UUID, no additional parameters.\r\n        Pattern pattern = Pattern.compile(\"^\/([\\\\p{Alpha}]+)(\/?([\\\\p{XDigit}-]+)?)?\");\r\n        Matcher matcher = pattern.matcher(req.getPathInfo());\r\n        matcher.find();\r\n\r\n        \/\/ verify this is a valid noun.\r\n        if ((matcher.groupCount() &gt;= 1) &amp;&amp; !validNouns.contains(matcher.group(1))) {\r\n            \/\/ LOG.info(\"unrecognized noun\");\r\n            LOG.info(\"unrecognized noun: '\" + matcher.group(1) + \"'\");\r\n            resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);\r\n            return false;\r\n        }\r\n\r\n        \/\/ verify this is a valid verb.\r\n        if ((matcher.groupCount() &gt;= 4) &amp;&amp; !StudentUtil.isPossibleUuid(matcher.group(4))) {\r\n            LOG.info(\"invalid UUID\");\r\n            resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);\r\n            return false;\r\n        }\r\n\r\n        return true;\r\n    }\r\n}<\/pre>\n<p>There\u2019s no reason why we can\u2019t also inspect the payload. For instance we can verify that dates, phone numbers and credit card numbers are properly formed; or that names only include letters (including non-Latin characters like \u00f1), spaces and apostrophes. (Think \u201cAnne-Marie Pe\u00f1a O\u2019Brien\u201d.) It\u2019s important to remember that these checks are not for \u2018valid\u2019 data \u2013 it\u2019s to eliminate clearly \u2018invalid\u2019 data.<\/p>\n<p>We must add the filter to our web.xml file.<\/p>\n<p><strong>web.xml<\/strong><\/p>\n<pre class=\" brush:java\">&lt;filter&gt;\r\n    &lt;filter-name&gt;REST parameter filter&lt;\/filter-name&gt;\r\n    &lt;filter-class&gt;com.invariantproperties.sandbox.student.webservice.security.RestParameterFilter&lt;\/filter-class&gt;\r\n     &lt;init-param&gt;\r\n        &lt;param-name&gt;valid-nouns&lt;\/param-name&gt;\r\n        &lt;param-value&gt;classroom,course,instructor,section,student,term,testRun&lt;\/param-value&gt;\r\n    &lt;\/init-param&gt;\r\n&lt;\/filter&gt;\r\n\r\n&lt;filter-mapping&gt;\r\n    &lt;filter-name&gt;REST parameter filter&lt;\/filter-name&gt;\r\n    &lt;servlet-name&gt;REST dispatcher&lt;\/servlet-name&gt;\r\n&lt;\/filter-mapping&gt;<\/pre>\n<h2>ModSecurity<\/h2>\n<p>It\u2019s easy to write a filter for simple elements like phone numbers and names but plaintext fields are another matter. These fields need the maximum flexibility while at the same time we want to minimize the risk of XSS and other attacks.<\/p>\n<p>A good resource along these lines is ModSecurity. This was originally an Apache module but it has been adopted by Trustwave Spider Labs. It sits on the web server \u2013 not the webapp \u2013 and inspects the data crossing it. A recent port (in summer 2013) allows it to be set up using a servlet filter instead of an external reverse proxy. (It uses JNI to instrument the containing appserver.)<\/p>\n<ul>\n<li>For more information see <a href=\"https:\/\/www.modsecurity.org\/projects\/modsecurity\/java\/index.html\">ModSecurity for Java<\/a>.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div style=\"border: 1px solid #D8D8D8; background: #FAFAFA; width: 100%; padding-left: 5px;\"><b><i>Reference: <\/i><\/b><a href=\"http:\/\/invariantproperties.com\/2014\/01\/06\/check-your-rest-parameters\/\">Check your REST parameters!<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">JCG partner<\/a> Bear Giles at the <a href=\"http:\/\/invariantproperties.com\/\">Invariant Properties<\/a> blog.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>I was doing research related to my ongoing \u201cproject student\u201d series and realized that I had made one of the most common \u2013 and most easily remedied \u2013 mistakes. I wasn\u2019t using everything I know about the webapp to push my security perimeter outwards. I am thinking specifically about the UUID parameters. I know that &hellip;<\/p>\n","protected":false},"author":113,"featured_media":112,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[54],"class_list":["post-20563","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-restful-web-services"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Check your REST parameters!<\/title>\n<meta name=\"description\" content=\"I was doing research related to my ongoing \u201cproject student\u201d series and realized that I had made one of the most common \u2013 and most easily remedied \u2013\" \/>\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.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Check your REST parameters!\" \/>\n<meta property=\"og:description\" content=\"I was doing research related to my ongoing \u201cproject student\u201d series and realized that I had made one of the most common \u2013 and most easily remedied \u2013\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2014-01-13T14:00:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Bear Giles\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bear Giles\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/01\\\/check-your-rest-parameters.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/01\\\/check-your-rest-parameters.html\"},\"author\":{\"name\":\"Bear Giles\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/91196fd6369bac9f4ec7217ffbca53f9\"},\"headline\":\"Check your REST parameters!\",\"datePublished\":\"2014-01-13T14:00:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/01\\\/check-your-rest-parameters.html\"},\"wordCount\":806,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/01\\\/check-your-rest-parameters.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"keywords\":[\"RESTful Web Services\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/01\\\/check-your-rest-parameters.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/01\\\/check-your-rest-parameters.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/01\\\/check-your-rest-parameters.html\",\"name\":\"Check your REST parameters!\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/01\\\/check-your-rest-parameters.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/01\\\/check-your-rest-parameters.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"datePublished\":\"2014-01-13T14:00:19+00:00\",\"description\":\"I was doing research related to my ongoing \u201cproject student\u201d series and realized that I had made one of the most common \u2013 and most easily remedied \u2013\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/01\\\/check-your-rest-parameters.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/01\\\/check-your-rest-parameters.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/01\\\/check-your-rest-parameters.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"java-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/01\\\/check-your-rest-parameters.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Check your REST parameters!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/91196fd6369bac9f4ec7217ffbca53f9\",\"name\":\"Bear Giles\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c4e8f47b520b4147cb7f173f9d78cf8862974fdeeff4baea9d6a632cf7b1b54c?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c4e8f47b520b4147cb7f173f9d78cf8862974fdeeff4baea9d6a632cf7b1b54c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c4e8f47b520b4147cb7f173f9d78cf8862974fdeeff4baea9d6a632cf7b1b54c?s=96&d=mm&r=g\",\"caption\":\"Bear Giles\"},\"sameAs\":[\"http:\\\/\\\/invariantproperties.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Bear-Giles\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Check your REST parameters!","description":"I was doing research related to my ongoing \u201cproject student\u201d series and realized that I had made one of the most common \u2013 and most easily remedied \u2013","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.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html","og_locale":"en_US","og_type":"article","og_title":"Check your REST parameters!","og_description":"I was doing research related to my ongoing \u201cproject student\u201d series and realized that I had made one of the most common \u2013 and most easily remedied \u2013","og_url":"https:\/\/www.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2014-01-13T14:00:19+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","type":"image\/jpeg"}],"author":"Bear Giles","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Bear Giles","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html"},"author":{"name":"Bear Giles","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/91196fd6369bac9f4ec7217ffbca53f9"},"headline":"Check your REST parameters!","datePublished":"2014-01-13T14:00:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html"},"wordCount":806,"commentCount":1,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","keywords":["RESTful Web Services"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html","url":"https:\/\/www.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html","name":"Check your REST parameters!","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","datePublished":"2014-01-13T14:00:19+00:00","description":"I was doing research related to my ongoing \u201cproject student\u201d series and realized that I had made one of the most common \u2013 and most easily remedied \u2013","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","width":150,"height":150,"caption":"java-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2014\/01\/check-your-rest-parameters.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Check your REST parameters!"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/91196fd6369bac9f4ec7217ffbca53f9","name":"Bear Giles","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c4e8f47b520b4147cb7f173f9d78cf8862974fdeeff4baea9d6a632cf7b1b54c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c4e8f47b520b4147cb7f173f9d78cf8862974fdeeff4baea9d6a632cf7b1b54c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c4e8f47b520b4147cb7f173f9d78cf8862974fdeeff4baea9d6a632cf7b1b54c?s=96&d=mm&r=g","caption":"Bear Giles"},"sameAs":["http:\/\/invariantproperties.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/Bear-Giles"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/20563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=20563"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/20563\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=20563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=20563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=20563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}