Skip to content

Error parsing read-only resource #147

Open
@zpi12lmm

Description

@zpi12lmm

API Platform version(s) affected: 4.1.7

Description
When I want to use operations on my read-only resource, I get an error like this:

Cannot find the class related to https://localhost/docs.jsonld#Entrypoint/greeting.

How to reproduce
This error can be reproduced as I described in this related issue: api-platform/api-platform#2870

Possible Solution
I don't know all the intricacies, but it would be nice to be able to handle read-only resources. It might be worth considering an option where, for a minimal check of the availability of a resource for parsing, there is a new GetCollection() operation, not a new Post().

Additional Context
I researched this issue myself and found that this parser for Hydra only works in two cases: when the "operations" attribute is not defined (i.e. all default operations are available), or when among the defined operations there is an operation to create a resource (i.e. new Post()).

As I understand it, the creation method is currently a fallback:

// As a fallback, find an operation available on the property of the entrypoint returning the searched type (usually POST)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions