Unable to generate IRI when using non-resource DTO as response #5155
Replies: 4 comments
-
MyEntity is missing an item get operation related: api-platform/docs#886, #3112, #3051 |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help so far! Actually, the full annotation reads:
So there is a get itemOperation (for persisted entities). The setup that worked for us was:
That no longer works. What I can do is generate a UUID for the "volatile" entity, the response will then contain a reference to an entity that does not exist. In v2.4.0-beta.2, the returned DTO was not accompanied by an IRI. It seems wrong to generate and return an IRI to an entity that was not persisted. It might be acceptable for our use-case, but is that how this is supposed to work? |
Beta Was this translation helpful? Give feedback.
-
This is working for me. Just decorate
|
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
We're still running v2.4.0-beta.2 and have a problem upgrading to v2.4.0 or higher.
I'm using a custom operation on an entity:
This works fine in v2.4.0-beta.2: we post an entity to the endpoint, our transformer performs some logic and returns a DTO, the DTO gets serialized and is returned as response.
Upgrading to any version above v2.4.0-beta.2 results in API platform trying to generate an IRI for the entity:
I'm unable to figure out the culprit, is this a bug in all versions of API platform above 2.4.0-beta2 or has something changed in the way non-resource responses should be implemented?
Following is a stack trace of the exception:
Seems related to #2910 and #2860
Beta Was this translation helpful? Give feedback.
All reactions