Skip to content

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

@enridelg

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.

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