title: Spring-API design parentid missing in child controller
body: <p>I am using spring boot for designing API. </p>
  
  <p>I am implementing following API design in the spring-boot.</p>
  
  <ol>
  <li>localhost:8989//parent.</li>
  <li>localhost:8989//parent/parentid </li>
  <li>localhost:8989//parent/parentid/child</li>
  </ol>
  
  <p>Following controller, I have implemented.</p>
  
  <pre><code>@RestController
  @RequestMapping(
   path="/parent",
   consumes=MediaType.APPLICATION_JSON_VALUE,
   produces=MediaType.APPLICATION_JSON_VALUE)
   public class ParentController {
           @RequestMapping(method=RequestMethod.GET)
           public @ResponseBody ResponseObject getAllParent() {
              //code to return all parent
           }      
           @RequestMapping(method=RequestMethod.GET, path="{id}")
           public @ResponseBody ResponseObject getParent(@PathVariable("id") 
                                                 Integer parentid) {
                //code to return specific parent
           }
           @RequestMapping(method=RequestMethod.GET, path="{id}/child")
           public @ResponseBody ResponseObject getParentChild 
                                      (@PathVariable("id")Integer parentid) {
                //code to return specific parent
           }
    }
  </code></pre>
  
  <p>Here i am requesting with below request.</p>
  
  <ol>
  <li>localhost:8989//parent ->works fine</li>
  <li>localhost:8989//parent/parentid ->works fine</li>
  <li><p>localhost:8989//parent/parentid/child-> Not working properly. Getting below error.</p>
  
  <p>{
      "timestamp": "2018-09-09T09:44:05.922+0000",
      "status": 500,
      "error": "Internal Server Error",
      "message": "Missing URI template variable 'parentid' for method parameter of type Integer",
      "path": "/parent/1536485852/child/"
  }</p></li>
  </ol>
  
  <p>Any help on this?</p>