You are here

public function JsonapiServiceProvider::register in JSON:API 8

Same name and namespace in other branches
  1. 8.2 src/JsonapiServiceProvider.php \Drupal\jsonapi\JsonapiServiceProvider::register()

Registers services to the container.

Parameters

ContainerBuilder $container: The ContainerBuilder to register services to.

Overrides ServiceProviderInterface::register

File

src/JsonapiServiceProvider.php, line 38

Class

JsonapiServiceProvider
Adds 'api_json' as known format and prevents its use in the REST module.

Namespace

Drupal\jsonapi

Code

public function register(ContainerBuilder $container) {
  $container
    ->addCompilerPass(new RegisterSerializationClassesCompilerPass());
  $container
    ->addCompilerPass(new RemoveJsonapiFormatCompilerPass(), PassConfig::TYPE_REMOVE);
}