Improve configuration validation
Description
Bundle configuration does not check if required package is installed before configuring associated services.
Example
In ApiPlatform\Symfony\Bundle\DependencyInjection\ApiPlatformExtension.php, we will configure the availble formats. If we try to configure the format jsonhal:
api_platform:
title: Hello API Platform
version: 1.0.0
formats:
jsonld: [ "application/ld+json" ]
jsonhal: [ "application/hal+json" ]
An exception is thrown saying "Invalid service "api_platform.hal.normalizer.entrypoint": class "ApiPlatform\Hal\Serializer\EntrypointNormalizer" does not exist".
Proposal In ApiPlatform\Symfony\Bundle\DependencyInjection\ApiPlatformExtension.php, check for required libraries associated with specific configuration. In the previous example, error message could be "Trying to configure jsonhal format, but required package api-platform/json-hal is not installed"
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.