-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
Description
Discussed in #6473
Originally posted by bpolaszek July 17, 2024
Hello there,
I just noticed that when using DTO output to create a different representation of the resource, the IRI returned by API-Platform is a generated one (as of API-Platform 3.x), instead of the original one (as of API-Platform 2.x).
TL; DR:
When requesting GET /api/books/1
, I get
{
"@type": "BookOutput",
"@id": "/api/.well-known/genid/b10ecd57cce7b0b65b14"
}
instead of
{
"@type": "Book",
"@id": "/api/books/1"
}
After further investigation, I think this is a regression from API-Platform 2.x.
Here's a minimal repository to reproduce the issue:
- A
Book
entity (type='entity'
) - A
BookOutput
representation (type='output'
) - A
StateProvider
- An integration test and its result
The final API consumer should not know anything about BookOutput
, they should just see a Book
with a valid IRI.
Thank you,
Ben
Metadata
Metadata
Assignees
Labels
No labels