api-platform icon indicating copy to clipboard operation
api-platform copied to clipboard

Error "Unable to generate an IRI" if id has "." or ":"

Open goltra opened this issue 10 months ago • 0 comments

API Platform version(s) affected: 3.2.20

Description
I'm doing an api rest that comunicate with couchdb server. I don't use Doctrine. I have User entity and I get info from couchDB users db. In CouchDB the id of a document is like "org.couchdb.user:xxx".

The problem is that any id string with "." or ":", the IRI can't be generated. You recieve "Unable to generate an IRI" Error.

I think that should be catch this case or maybe there is another way that I can't find.

For the moment, I'm transforming my Id in getter but I know that this is not a good solution.

public function getId(): ?string { return str_ireplace([':','.'],['-','*'], $this->id); }

goltra avatar Apr 05 '24 07:04 goltra