title: document hierarchical JSON payload with Spring REST Docs
body: <p>I started to use <a href="http://projects.spring.io/spring-restdocs/" rel="nofollow">Spring REST Docs</a> to document a simple REST API. I have a payload that has some hierarchical structure, for example like this (company with employees).</p>
  
  <pre><code>{
      "companyName": "FooBar",
      "employee": 
      [
          {
              "name": "Lorem",
              "age": "42"
          },
  
          {
              "name": "Ipsum",
              "age": "24"
          }
      ]
  }
  </code></pre>
  
  <p>I would like to separate the documentation of the company object (name and array of employees) and the employee object (employee name and age).</p>
  
  <p>Using the <code>org.springframework.restdocs.payload.PayloadDocumentation.responseFields</code> like explained <a href="http://docs.spring.io/spring-restdocs/docs/1.0.0.RC1/reference/html5/#documenting-your-api-request-response-payloads" rel="nofollow">here</a> forces me to document all fields but in case I only want to document the <em>employee</em> fields - how can I achieve this?</p>
  
  <p>I have no problem to document the company without the employee details because if a field is document the descendants are treated as been documented also. But I can not document the employee structure on its own and I have no dedicated payload for this structure without the company root object.</p>