Linking DTO resources #7326
Replies: 2 comments 2 replies
-
Yes many ways, either using a Link with correct from/to class when using doctrine or simply https://github.com/api-platform/core/blob/main/src/State/ParameterProvider/ReadLinkParameterProvider.php (examples in our tests I'm still writing the docs) |
Beta Was this translation helpful? Give feedback.
-
@fbourigault by which Am having a similar situation here: can't manage to get it working to have a For context; this is a DDD scenario where we need to introduce a strict boundary between two aggregate roots of two separate bounded contexts. They should get identified through their identifiers, and not through a Doctrine relationship. #[ApiResource(
operations: [
new GetCollection(
uriTemplate: '/authors/{authorId}/books',
uriVariables: ['authorId' => new Link(property: 'authorId')],
),
],
)]
class Book
{
private Uuid $authorId;
} Can't find a way (e.g. in the docs) on using the Imho the Other attempts
@soyuka would be great to have documentation on which fields on these metadata classes actually do something 🙌 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Given the following resources :
Is there a way to tell API Platform that
Book::$author
should be a link to theAuthor
resource?Beta Was this translation helpful? Give feedback.
All reactions