API Platform 3 Part 1: Mythically Good RESTful APIs
Relating Resources
  Start your All-Access Pass to unlock this challenge
Buy Access Login

Challenge 1 / 1

Suppose we have a Product entity with the following category property:

#[ApiResource(normalizationContext: ['groups' => 'product:read']]
class Product
{
    // ...
    #[Groups('product:read')]
    public Category $category;
}

Also assume the Category class has #[ApiResource]. If someone makes a GET request to /api/products/1, what will the category field look like?

Skip challenges and go to theNext Chapter

Turn Challenges Off?

All further challenges will be skipped automatically.
You can re-enable challenges at any time on this page or from your account page.