If you're using an "Accept" HTTP header to set the serialization groups, you need to define allowed groups
either by passing them as default in serialization_groups setting or marking them as allowed in
allowed_serialization_groups setting, both settings are set in the route definition (under _sylius key).