function JsonapiServiceProvider::register

Same name in other branches
  1. 9 core/modules/jsonapi/src/JsonapiServiceProvider.php \Drupal\jsonapi\JsonapiServiceProvider::register()
  2. 8.9.x core/modules/jsonapi/src/JsonapiServiceProvider.php \Drupal\jsonapi\JsonapiServiceProvider::register()
  3. 11.x core/modules/jsonapi/src/JsonapiServiceProvider.php \Drupal\jsonapi\JsonapiServiceProvider::register()

Overrides ServiceProviderInterface::register

File

core/modules/jsonapi/src/JsonapiServiceProvider.php, line 39

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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.