Admin throws error "Cannot find the class related to [Entrypoint/RESOURCE_NAME]" if POST operation is removed from ApiResource · Issue #615 · api-platform/admin · GitHub
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
{{ message }}
Repository navigation
Admin throws error "Cannot find the class related to [Entrypoint/RESOURCE_NAME]" if POST operation is removed from ApiResource #615
Description
When I remove the POST operation from an ApiResource, the Admin UI throws the following error: Cannot find the class related to https://localhost/api/docs.jsonld#Entrypoint/[RESOURCE_NAME]
Enabling Hydra prefixes in the API Platform config (which is disabled by default in v4) resolves the issue with the same resource operations.
How to reproduce
In a fresh install of API Platform (v4.x), modify the Greeting resource to only include GET and GET Collection operations:
Expected behavior
The Admin UI should work even if the POST operation is removed from the resource, and without requiring Hydra to be explicitly enabled.
I've got the idea that this issue relates to entities / resources of which the entrypoint name would be more than one word. Am facing the same issue for an entity named "FooBar", while defining just these two operations as mentioned above for an entity named "Foo" it does work.
# Works
#[ApiResource(
operations: [
newGet(),
newGetCollection(),
],
)]
class Foo {}
# Fails. lets APIP ReactAdmin throw 'Cannot fetch API documentation: Cannot find the class related to https://localhost/docs.jsonld#Entrypoint/fooBar
#[ApiResource(
operations: [
newGet(),
newGetCollection(),
],
)]
class FooBar {}
@slax57 does that match your reproducer? And what would it take to expect an incoming fix?
@rvanlaak My reproducer used the 'Greetings' resource like suggested by the OP. So no, this doesn't seem to be related to the entity name.
I can't tell you when this will be fixed. Feel free to have a look at it yourself if you are facing this issue and it is a problem to you. We'll gladly welcome a PR if you manage to find a fix.
Also remind there is a workaround for this issue: Enabling Hydra prefixes in the API Platform config (as stated by the OP).
Activity
slax57 commentedon May 28, 2025
Reproduced, thanks!
radarve commentedon Jul 31, 2025
I’m experiencing the same issue. Has there been any progress on this or a known workaround?
rvanlaak commentedon Nov 14, 2025
I've got the idea that this issue relates to entities / resources of which the entrypoint name would be more than one word. Am facing the same issue for an entity named "FooBar", while defining just these two operations as mentioned above for an entity named "Foo" it does work.
@slax57 does that match your reproducer? And what would it take to expect an incoming fix?
slax57 commentedon Nov 17, 2025
@rvanlaak My reproducer used the 'Greetings' resource like suggested by the OP. So no, this doesn't seem to be related to the entity name.
I can't tell you when this will be fixed. Feel free to have a look at it yourself if you are facing this issue and it is a problem to you. We'll gladly welcome a PR if you manage to find a fix.
Also remind there is a workaround for this issue: Enabling Hydra prefixes in the API Platform config (as stated by the OP).