title: How to count members with jsonpath?
body: <p>Is it possible to count the number of members using JsonPath?</p>
  <p>Using <a href="https://github.com/SpringSource/spring-test-mvc" rel="noreferrer">Spring MVC test</a> I'm testing a controller that generates</p>
  <pre class="lang-json prettyprint-override"><code>{&quot;foo&quot;: &quot;oof&quot;, &quot;bar&quot;: &quot;rab&quot;}
  </code></pre>
  <p>with:</p>
  <pre class="lang-java prettyprint-override"><code>standaloneSetup(new FooController(fooService)).build()
      .perform(get(&quot;/something&quot;).accept(MediaType.APPLICATION_JSON)).andExpect(status().isOk())
      .andExpect(jsonPath(&quot;$.foo&quot;).value(&quot;oof&quot;))
      .andExpect(jsonPath(&quot;$.bar&quot;).value(&quot;rab&quot;));
  </code></pre>
  <p>I'd like to make sure that no other members are present in the generated json. Hopefully by counting them using jsonPath. Is it possible? Alternate solutions are welcome too.</p>