You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Im not sure if it is kinda a bug or im just doing it wrong. Im using Ramsey UUID Doctrine extension to store binary uuids in my MySQL 8 database. This all works well and i can insert them and reading them is also fine using an ApiPlatform resource.
However it goes wrong when i try to do a GET on a resource with an invalid UUID. For example when i query on ID 1234 it gives me this error with a 500 response: Could not convert database value \"123\" to Doctrine Type uuid_binary
I expect it to return me a 400 or maybe even a 404 because it does not know it.
#[ApiResource(
operations: [
new Get(),
new GetCollection(),
],
routePrefix: '/v1',
)]
#[ORM\Entity()]
#[ORM\Table(name: '`user`')]
class User
{
#[ApiProperty(identifier: true)]
#[ORM\Id, ORM\Column(name: 'user_id', type: 'uuid_binary')]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: UuidGenerator::class)]
#[Assert\Uuid]
public string $id;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Im not sure if it is kinda a bug or im just doing it wrong. Im using Ramsey UUID Doctrine extension to store binary uuids in my MySQL 8 database. This all works well and i can insert them and reading them is also fine using an ApiPlatform resource.
However it goes wrong when i try to do a GET on a resource with an invalid UUID. For example when i query on ID
1234
it gives me this error with a 500 response:Could not convert database value \"123\" to Doctrine Type uuid_binary
I expect it to return me a 400 or maybe even a 404 because it does not know it.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions