title: JAX-RS consume JSON and read it with javax.json
body: <p>How to consume json from post and read it with javax.json </p>
  
  <p>how to do it without add more depencies or relate json to entity bean</p>
  
  <p><strong>json (application/json)</strong></p>
  
  <pre><code>{"employees":[
     {"firstName":"John", "lastName":"Doe"}, 
     {"firstName":"Anna", "lastName":"Smith"},
     {"firstName":"Peter", "lastName":"Jones"}
  ]}
  </code></pre>
  
  <p><strong>server</strong></p>
  
  <pre><code>    @POST
      @Consumes(MediaType.APPLICATION_JSON)
      @Produces("text/plain")
      public String receiveJSON( whatShouldIput data ){
  
        JsonReader reader = Json.createReader(data );
        JsonObject obj = reader.readObject();
        JsonArray results = obj.getJsonArray("data");
        for (JsonObject result : results.getValuesAs(JsonObject.class)) {
            System.out.print(result.getJsonObject("employees").getString("firstName"));
            System.out.print(" ");
            System.out.println(result.getString("lastName", ""));
            System.out.println("-----------");
       }
  
          return "ok";
      }
  </code></pre>