title: How to work with JSON coming from api-platform
body: <p>I've installed the <a href="https://api-platform.com/" rel="nofollow noreferrer">api-platform</a> demo on a server and I did a client app (working with Symfony 3.3) and I want to display the response in a classic view (Twig).</p>
  
  <p>Everything's working fine : I can request and retrieve the response.</p>
  
  <p>But here's where i'm stuck : when I dump the response in my view I got this </p>
  
  <pre><code> {"@context":"\/contexts\/Book","@id":"\/books","@type":"hydra:Collection","hydra:member":[{"@id":"\/books\/1","@type":"Book","id":1,"isbn":"9783161484100","title":"1st Book","description":"This is my first book synopsis","author":"Hemingroad","publicationDate":"2018-02-16T14:15:58+00:00","reviews":[]}],"hydra:totalItems":1}
  </code></pre>
  
  <p>Here's my controller's method :</p>
  
  <pre><code> //...
   use GuzzleHttp\Client;
  
  public function newAction(Request $request)
  {
       //initialize client API
      $client = new Client([
          'base_uri' =&gt; 'http://my.apidomain.com/',
          'timeout'  =&gt; 2.0,
      ]);
  
      //request to API
      $dataBooks = $client-&gt;request('GET', 'books', ['auth' =&gt; ['login', 'p@$$w0rd']]);
      $listBooks = $dataBooks-&gt;getBody()-&gt;getContents();
      return $this-&gt;render('book/new.html.twig', array(
          'listBooks'   =&gt; $listBooks
      ));
  }
  </code></pre>
  
  <p>I've also tried to json_decode and using <a href="https://jmsyst.com/libs/serializer" rel="nofollow noreferrer">JMSSerializer</a> on $listBooks.
  I got a beautiful object but I still cant access the JSON attribute's like ISBN, title by doing something like </p>
  
  <pre><code> {% for book in listBooks %}
        {{ dump(book.title) }}
         &lt;!-- .... --&gt;
   {% endfor %}
  </code></pre>
  
  <p>Here's what I got when I json_decode $listBooks : </p>
  
  <pre><code>  {{ dump(listBooks) }}
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/7kGuo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7kGuo.png" alt="enter image description here"></a></p>
  
  <p>I got an error when I try to access every field like this </p>
  
  <pre><code>  {{ dump(listBooks.@id) }}
    {{ dump(listBooks['hydra:member']) }}
    ....
  </code></pre>
  
  <p>Am I missing something ? </p>
  
  <p>Thanks </p>