title: Symfony - Expected value of type '' got "string" instead
body: <p>I am trying to pass id from one country table to user table but I can't' pass this error..</p>
  
  <blockquote>
    <p>Expected value of type "ProjectBundle\Base\Entity\Country" for association field "ProjectBundle\Base\Entity\User#$country", got "string" instead.</p>
  </blockquote>
  
  <p>My User entity class</p>
  
  <pre><code>class User extends BaseUser
  {
  /**
   * @ORM\Id
   * @ORM\Column(type="integer")
   * @ORM\GeneratedValue(strategy="AUTO")
   * @Groups({"user_data"})
   */
  protected $id;
  
  /**
   * @ORM\ManyToOne(targetEntity="Country")
   * @JoinColumn(name="country_id", referencedColumnName="id")
   */
  private $country;
  
  
  /**
   * @return mixed
   */
  public function getCountry()
  {
      return $this-&gt;country;
  }
  
  /**
   * @param mixed $country
   */
  public function setCountry($country)
  {
      $this-&gt;country = $country;
  }
  </code></pre>
  
  <p>My User service</p>
  
  <pre><code> public function registerUser($country)
  {
      $user = new User();
      $user-&gt;setCountry($country);
  
      $this-&gt;em-&gt;persist($user);
      $this-&gt;em-&gt;flush();
  
  
      return $user;
  }
  </code></pre>
  
  <p>My User controller</p>
  
  <pre><code> public function registerUserAction()
  {
      $this-&gt;requirePostParams(['country_id']);
  
      $country = $this-&gt;data['country_id'];
  
      $user =  $this-&gt;get('member')-&gt;registerUser($country);
  
      return $this-&gt;success($user);
  }
  </code></pre>
  
  <p>So I am passing country_id value via postman and I get this error.</p>