dotkernel / api

DotKernel's PSR-7 REST style API built around the Mezzio API skeleton.
https://docs.dotkernel.org/api-documentation/
MIT License
26 stars 4 forks source link

Application exception on latest version #231

Open tasselchof opened 2 months ago

tasselchof commented 2 months ago

Hi,

I encountered this exception while attempting to retrieve users from the database:

TypeError raised in file /home/dev/domains/api-dev.app/vendor/doctrine/persistence/src/Persistence/Reflection/RuntimeReflectionProperty.php line 61:
Message: Cannot assign resource to property Api\App\Entity\AbstractEntity::$uuid of type ?Ramsey\Uuid\UuidInterface

It's standard application, except I removed link to the roles (trying to build basic graphql api - to get users together with table properties for my frontend).

I am using ramsey/uuid-doctrine with dbal:4.0 though (your repo has a limitation dbal:3.0).

I'll probably figure it our myself, but if you have an idea where the issue might be I would be grateful.

arhimede commented 2 months ago

we are planning the switch to doctrine 3 and dbal 4 , in the version 5 of the API https://github.com/orgs/dotkernel/projects/13

So is not tested at all with DBAL 4 . Right now we are focused on documenting all packages https://github.com/orgs/dotkernel/projects/17

tasselchof commented 2 months ago

Do you think it’s related?

arhimede commented 2 months ago

@tasselchof not necessarily related, but at least the initial stack is stable ( with dbal 3) .

Is a type related issue.

tasselchof commented 2 months ago

@arhimede the problem is in uuid type, I guess something about this one: https://github.com/doctrine/dbal/blob/4.0.x/UPGRADE.md#bc-break-changes-to-handling-binary-fields.

arhimede commented 2 months ago

@arhimede the problem is in uuid type, I guess something about this one: https://github.com/doctrine/dbal/blob/4.0.x/UPGRADE.md#bc-break-changes-to-handling-binary-fields.

Better go back to DBAL 3 and play there...

tasselchof commented 2 months ago

I just fixed the types provided by Ramsey/doctrine-uuid, and they are now working with dbal version 4.0.1. However, I am not sure if this library will be updated soon enough. I mean, I can submit a pull request here, but it's obviously going to be more than just "updating the version": https://github.com/ramsey/uuid-doctrine/pull/247.