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
Skip to content

Admin throws error "Cannot find the class related to [Entrypoint/RESOURCE_NAME]" if POST operation is removed from ApiResource #615

Open

Description

@enridelg

API Platform version(s) affected: 4.0.6

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:

#[ApiResource(operations: [new Get(), new GetCollection()])]

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.

Activity

  1. added theissue type on May 28, 2025
  2. slax57 commented on May 28, 2025

    @slax57
    Contributor

    Reproduced, thanks!

  3. radarve commented on Jul 31, 2025

    @radarve

    I’m experiencing the same issue. Has there been any progress on this or a known workaround?

  4. rvanlaak commented on Nov 14, 2025

    @rvanlaak

    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: [
            new Get(),
            new GetCollection(),
        ],
    )]
    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: [
            new Get(),
            new GetCollection(),
        ],
    )]
    class FooBar {}

    @slax57 does that match your reproducer? And what would it take to expect an incoming fix?

  5. slax57 commented on Nov 17, 2025

    @slax57
    Contributor

    @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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions