title: Can't validate child entity in APiPlatform
body: <p>I've an <code>Order</code> object and an <code>OrderDetails</code>. I want to send the order object with the OrderDetails in one POST call. But ApiPlatform never validate the OrderDetails entity. I just get an DB error that the field quantity can not be empty. What do I wrong here?</p>
  <p>Here my <code>Order entity</code>.</p>
  <pre><code>/**
   * @ORM\Entity(repositoryClass=OrderRepository::class)
   * @ORM\Table(name=&quot;`tblInternetAuftraege`&quot;)
   * @Vich\Uploadable
   */
  #[ApiResource(
     collectionOperations: [
      'POST' =&gt; [
          'input_formats' =&gt; [
              'json' =&gt; ['application/json'],
              'multipart' =&gt; ['multipart/form-data'],
          ],
          'normalization_context' =&gt; ['groups' =&gt; ['ORDER_POST'],'swagger_definition_name' =&gt; 'POST'],
          'denormalization_context' =&gt; ['groups' =&gt; ['ORDER_POST'],'swagger_definition_name' =&gt; 'POST']
      ],
      'GET' =&gt; [
          'normalization_context' =&gt; ['groups' =&gt; ['ORDER_READ'],'swagger_definition_name' =&gt; 'READ'],
          'denormalization_context' =&gt; ['groups' =&gt; ['ORDER_READ'],'swagger_definition_name' =&gt; 'READ']
      ]
  ],
  itemOperations: [
      'PUT' =&gt; [
          'security' =&gt; 'is_granted(\'ORDER_PUT\', object)',
          'normalization_context' =&gt; ['groups' =&gt; ['ORDER_PUT'],'swagger_definition_name' =&gt; 'PUT'],
          'denormalization_context' =&gt; ['groups' =&gt; ['ORDER_PUT'],'swagger_definition_name' =&gt; 'PUT']
      ],
      'PATCH' =&gt; [
          'security' =&gt; 'is_granted(\'ORDER_PATCH\', object)',
          'normalization_context' =&gt; ['groups' =&gt; ['ORDER_PUT'],'swagger_definition_name' =&gt; 'PATCH'],
          'denormalization_context' =&gt; ['groups' =&gt; ['ORDER_PUT'],'swagger_definition_name' =&gt; 'PATCH']
      ],
      'GET' =&gt; [
          'normalization_context' =&gt; ['groups' =&gt; ['ORDER_READ'],'swagger_definition_name' =&gt; 'READ'],
          'denormalization_context' =&gt; ['groups' =&gt; ['ORDER_READ'],'swagger_definition_name' =&gt; 'READ']
      ]
  ],
  )]
  #[OrangefluidAssert\OrderData]
  class Order {
  /**
   * @ORM\Id
   * @ORM\GeneratedValue
   * @ORM\Column(type=&quot;integer&quot;, name=&quot;ID&quot;,options={&quot;default&quot;:0})
   *
   * @Groups({&quot;ORDER_READ&quot;,&quot;ORDER_PUT&quot;, &quot;ORDER_POST&quot;})
   */
  private int $id = 0;
  
  /**
   * @ORM\OneToOne(targetEntity=OrderDetails::class, mappedBy=&quot;order&quot;, cascade={&quot;persist&quot;,&quot;remove&quot;})
   * @Assert\NotBlank()
   * @Groups({&quot;ORDER_READ&quot;,&quot;ORDER_PUT&quot;, &quot;ORDER_POST&quot;})
   */
  private OrderDetails $details;
  }
  </code></pre>
  <p>and here the <code>OrderDetails entity</code></p>
  <pre><code>/**
   * @ORM\Entity
   * @ORM\Table(name=&quot;`tblInternetTDSB`&quot;)
   */
   #[ApiResource(
  collectionOperations: ['GET'],
  itemOperations: ['GET']
  )]
  class OrderDetails {
  /**
   * @ORM\Id
   * @ORM\GeneratedValue
   * @ORM\Column(type=&quot;integer&quot;, name=&quot;ID&quot;)
   *
   * @Groups({&quot;ORDER_READ&quot;,&quot;ORDER_PUT&quot;, &quot;ORDER_POST&quot;})
   */
  #[ApiProperty(
      writable: false
  )]
  private ?int $id = 0;
  
  /**
   * @var int
   * @ORM\Column(type=&quot;integer&quot;, name=&quot;Anzahl&quot;, nullable=false)
   * @Assert\NotBlank()
   * @Groups({&quot;ORDER_READ&quot;,&quot;ORDER_PUT&quot;, &quot;ORDER_POST&quot;})
   */
  #[ApiProperty(
      required: true,
      description: 'Die gewünschte Bestellmenge',
      example: '12'
  )]
  private int $quantity;
  </code></pre>
  <p>}</p>