core
core copied to clipboard
feat(doctrine): add requirements dynamically based on doctrine field
| Q | A |
|---|---|
| Branch? | main |
| Tickets | Closes #7476 |
| License | MIT |
| Doc PR | api-platform/docs#... |
Test are failing because of this line https://github.com/api-platform/core/blob/15ea6d8f7aa163d4daa06bc9b3080c14cb87daac/tests/Fixtures/TestBundle/State/ContainNonResourceProvider.php#L41
1-nested is set as id to the nested ressource and then the uri is not correctly generated because it's not a valid id.
I feel like the error is still legit because the resource has
#[ORM\Column(type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[Groups('contain_non_resource')]
which means that 1-nested will never be a valid id.
But it still make me think I cannot add automatically a requirement if a Provider is used.