Flag of Ukraine
SymfonyCasts stands united with the people of Ukraine
Next Chapter

Challenge #1 of 1


Q: 

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?

userVoice