class SchemataServiceProvider in Schemata 8
Adds schema_json as known format.
Hierarchy
- class \Drupal\schemata\SchemataServiceProvider implements ServiceModifierInterface
Expanded class hierarchy of SchemataServiceProvider
File
- src/
SchemataServiceProvider.php, line 12
Namespace
Drupal\schemataView source
class SchemataServiceProvider implements ServiceModifierInterface {
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
if ($container
->has('http_middleware.negotiation') && is_a($container
->getDefinition('http_middleware.negotiation')
->getClass(), NegotiationMiddleware::class, TRUE)) {
// @see https://www.ietf.org/id/draft-wright-json-schema-00.txt
$container
->getDefinition('http_middleware.negotiation')
->addMethodCall('registerFormat', [
'schema_json',
[
'application/schema+json',
],
]);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SchemataServiceProvider:: |
public | function |
Modifies existing service definitions. Overrides ServiceModifierInterface:: |