You are here

jsonapi.services.yml in JSON:API 8

Same filename and directory in other branches
  1. 8.2 jsonapi.services.yml

File

jsonapi.services.yml
View source
  1. parameters:
  2. jsonapi.base_path: /jsonapi
  3. services:
  4. jsonapi.serializer_do_not_use_removal_imminent:
  5. class: Drupal\jsonapi\Serializer\Serializer
  6. public: false
  7. calls:
  8. - [setFallbackNormalizer, ['@serializer']]
  9. arguments: [{ }, { }]
  10. serializer.normalizer.sort.jsonapi:
  11. class: Drupal\jsonapi\Normalizer\SortNormalizer
  12. arguments: ['@jsonapi.field_resolver']
  13. tags:
  14. - { name: jsonapi_normalizer_do_not_use_removal_imminent }
  15. serializer.normalizer.offset_page.jsonapi:
  16. class: Drupal\jsonapi\Normalizer\OffsetPageNormalizer
  17. tags:
  18. - { name: jsonapi_normalizer_do_not_use_removal_imminent }
  19. serializer.normalizer.entity_condition.jsonapi:
  20. class: Drupal\jsonapi\Normalizer\EntityConditionNormalizer
  21. tags:
  22. - { name: jsonapi_normalizer_do_not_use_removal_imminent }
  23. serializer.normalizer.entity_condition_group.jsonapi:
  24. class: Drupal\jsonapi\Normalizer\EntityConditionGroupNormalizer
  25. tags:
  26. - { name: jsonapi_normalizer_do_not_use_removal_imminent }
  27. serializer.normalizer.filter.jsonapi:
  28. class: Drupal\jsonapi\Normalizer\FilterNormalizer
  29. arguments: ['@jsonapi.field_resolver', '@serializer.normalizer.entity_condition.jsonapi', '@serializer.normalizer.entity_condition_group.jsonapi']
  30. tags:
  31. - { name: jsonapi_normalizer_do_not_use_removal_imminent }
  32. serializer.normalizer.http_exception.jsonapi:
  33. class: Drupal\jsonapi\Normalizer\HttpExceptionNormalizer
  34. arguments: ['@current_user']
  35. tags:
  36. - { name: jsonapi_normalizer_do_not_use_removal_imminent }
  37. serializer.normalizer.unprocessable_entity_exception.jsonapi:
  38. class: Drupal\jsonapi\Normalizer\UnprocessableHttpEntityExceptionNormalizer
  39. arguments: ['@current_user']
  40. tags:
  41. # This must have a higher priority than the 'serializer.normalizer.http_exception.jsonapi' to take effect.
  42. - { name: jsonapi_normalizer_do_not_use_removal_imminent, priority: 1 }
  43. serializer.normalizer.entity_access_exception.jsonapi:
  44. class: Drupal\jsonapi\Normalizer\EntityAccessDeniedHttpExceptionNormalizer
  45. arguments: ['@current_user']
  46. tags:
  47. # This must have a higher priority than the 'serializer.normalizer.http_exception.jsonapi' to take effect.
  48. - { name: jsonapi_normalizer_do_not_use_removal_imminent, priority: 1 }
  49. serializer.normalizer.entity_reference_item.jsonapi:
  50. class: Drupal\jsonapi\Normalizer\RelationshipItemNormalizer
  51. arguments: ['@jsonapi.resource_type.repository']
  52. tags:
  53. - { name: jsonapi_normalizer_do_not_use_removal_imminent }
  54. serializer.normalizer.field_item.jsonapi:
  55. class: Drupal\jsonapi\Normalizer\FieldItemNormalizer
  56. tags:
  57. - { name: jsonapi_normalizer_do_not_use_removal_imminent }
  58. serializer.normalizer.field.jsonapi:
  59. class: Drupal\jsonapi\Normalizer\FieldNormalizer
  60. tags:
  61. - { name: jsonapi_normalizer_do_not_use_removal_imminent }
  62. serializer.normalizer.relationship.jsonapi:
  63. class: Drupal\jsonapi\Normalizer\RelationshipNormalizer
  64. arguments: ['@jsonapi.resource_type.repository', '@jsonapi.link_manager']
  65. tags:
  66. - { name: jsonapi_normalizer_do_not_use_removal_imminent }
  67. serializer.normalizer.entity.jsonapi:
  68. class: Drupal\jsonapi\Normalizer\ContentEntityNormalizer
  69. arguments: ['@jsonapi.link_manager', '@jsonapi.resource_type.repository', '@entity_type.manager']
  70. tags:
  71. - { name: jsonapi_normalizer_do_not_use_removal_imminent }
  72. serializer.normalizer.config_entity.jsonapi:
  73. class: Drupal\jsonapi\Normalizer\ConfigEntityNormalizer
  74. arguments: ['@jsonapi.link_manager', '@jsonapi.resource_type.repository', '@entity_type.manager']
  75. tags:
  76. - { name: jsonapi_normalizer_do_not_use_removal_imminent }
  77. serializer.normalizer.jsonapi_document_toplevel.jsonapi:
  78. class: Drupal\jsonapi\Normalizer\JsonApiDocumentTopLevelNormalizer
  79. arguments: ['@jsonapi.link_manager', '@entity_type.manager', '@jsonapi.resource_type.repository']
  80. tags:
  81. - { name: jsonapi_normalizer_do_not_use_removal_imminent }
  82. serializer.normalizer.entity_reference_field.jsonapi:
  83. class: Drupal\jsonapi\Normalizer\EntityReferenceFieldNormalizer
  84. arguments: ['@jsonapi.link_manager', '@entity_field.manager', '@plugin.manager.field.field_type', '@jsonapi.resource_type.repository', '@entity.repository']
  85. tags:
  86. # This must have a higher priority than the 'serializer.normalizer.field.jsonapi' to take effect.
  87. - { name: jsonapi_normalizer_do_not_use_removal_imminent, priority: 1 }
  88. serializer.encoder.jsonapi:
  89. class: Drupal\jsonapi\Encoder\JsonEncoder
  90. tags:
  91. - { name: encoder, priority: 21, format: 'api_json' }
  92. jsonapi.resource_type.repository:
  93. class: Drupal\jsonapi\ResourceType\ResourceTypeRepository
  94. arguments: ['@entity_type.manager', '@entity_type.bundle.info', '@entity_field.manager']
  95. jsonapi.route_enhancer:
  96. class: Drupal\jsonapi\Routing\RouteEnhancer
  97. tags:
  98. - { name: route_enhancer }
  99. jsonapi.params.enhancer:
  100. class: Drupal\jsonapi\Routing\JsonApiParamEnhancer
  101. arguments: ['@serializer.normalizer.filter.jsonapi', '@serializer.normalizer.sort.jsonapi', '@serializer.normalizer.offset_page.jsonapi']
  102. tags:
  103. - { name: route_enhancer }
  104. jsonapi.link_manager:
  105. class: Drupal\jsonapi\LinkManager\LinkManager
  106. arguments: ['@router.no_access_checks', '@url_generator']
  107. jsonapi.field_resolver:
  108. class: Drupal\jsonapi\Context\FieldResolver
  109. arguments: ['@entity_type.manager', '@entity_field.manager', '@entity_type.bundle.info', '@jsonapi.resource_type.repository', '@module_handler']
  110. access_check.jsonapi.custom_query_parameter_names:
  111. class: Drupal\jsonapi\Access\CustomQueryParameterNamesAccessCheck
  112. tags:
  113. - { name: access_check, applies_to: _jsonapi_custom_query_parameter_names, needs_incoming_request: TRUE }
  114. paramconverter.jsonapi.entity_uuid:
  115. class: Drupal\jsonapi\ParamConverter\EntityUuidConverter
  116. tags:
  117. # Priority 10, to ensure it runs before @paramconverter.entity.
  118. - { name: paramconverter, priority: 10 }
  119. arguments: ['@entity.manager']
  120. paramconverter.jsonapi.resource_type:
  121. class: Drupal\jsonapi\ParamConverter\ResourceTypeConverter
  122. arguments: ['@jsonapi.resource_type.repository']
  123. tags:
  124. - { name: paramconverter }
  125. jsonapi.exception_subscriber:
  126. class: Drupal\jsonapi\EventSubscriber\DefaultExceptionSubscriber
  127. tags:
  128. - { name: event_subscriber }
  129. arguments: ['@jsonapi.serializer_do_not_use_removal_imminent', '%serializer.formats%']
  130. jsonapi.http_middleware.format_setter:
  131. class: Drupal\jsonapi\StackMiddleware\FormatSetter
  132. arguments: ['%jsonapi.base_path%']
  133. tags:
  134. # Set priority to 201 so it happens right before the page cache
  135. # middleware (priority 200)has the opportunity to respond.
  136. - { name: http_middleware, priority: 201 }
  137. jsonapi.entity.to_jsonapi:
  138. class: Drupal\jsonapi\EntityToJsonApi
  139. arguments: ['@jsonapi.serializer_do_not_use_removal_imminent', '@jsonapi.resource_type.repository', '@current_user', '@request_stack', '%jsonapi.base_path%']
  140. logger.channel.jsonapi:
  141. parent: logger.channel_base
  142. arguments: ['jsonapi']
  143. # Controllers.
  144. jsonapi.request_handler:
  145. class: \Drupal\jsonapi\Controller\RequestHandler
  146. arguments:
  147. - '@jsonapi.serializer_do_not_use_removal_imminent'
  148. - '@jsonapi.resource_type.repository'
  149. - '@entity_type.manager'
  150. - '@entity_field.manager'
  151. - '@plugin.manager.field.field_type'
  152. - '@jsonapi.link_manager'
  153. - '@renderer'
  154. # Event subscribers.
  155. jsonapi.resource_response.subscriber:
  156. class: Drupal\jsonapi\EventSubscriber\ResourceResponseSubscriber
  157. arguments: ['@jsonapi.serializer_do_not_use_removal_imminent']
  158. tags:
  159. - { name: event_subscriber }
  160. jsonapi.resource_response_validator.subscriber:
  161. class: Drupal\jsonapi\EventSubscriber\ResourceResponseValidator
  162. arguments: ['@jsonapi.serializer_do_not_use_removal_imminent', '@logger.channel.jsonapi', '@module_handler', '@app.root']
  163. calls:
  164. - [setValidator, []]
  165. - [setSchemaFactory, ['@?schemata.schema_factory']] # This is only injected when the service is available.
  166. tags:
  167. - { name: event_subscriber, priority: 1000 }
  168. # Deprecated services.
  169. serializer.normalizer.htt_exception.jsonapi:
  170. alias: serializer.normalizer.http_exception.jsonapi
  171. deprecated: The "%service_id%" service is deprecated. You should use the 'serializer.normalizer.http_exception.jsonapi' service instead.

Services

Namesort descending Description
access_check.jsonapi.custom_query_parameter_names Drupal\jsonapi\Access\CustomQueryParameterNamesAccessCheck
jsonapi.entity.to_jsonapi Drupal\jsonapi\EntityToJsonApi
jsonapi.exception_subscriber Drupal\jsonapi\EventSubscriber\DefaultExceptionSubscriber
jsonapi.field_resolver Drupal\jsonapi\Context\FieldResolver
jsonapi.http_middleware.format_setter Drupal\jsonapi\StackMiddleware\FormatSetter
jsonapi.link_manager Drupal\jsonapi\LinkManager\LinkManager
jsonapi.params.enhancer Drupal\jsonapi\Routing\JsonApiParamEnhancer
jsonapi.request_handler \Drupal\jsonapi\Controller\RequestHandler
jsonapi.resource_response.subscriber Drupal\jsonapi\EventSubscriber\ResourceResponseSubscriber
jsonapi.resource_response_validator.subscriber Drupal\jsonapi\EventSubscriber\ResourceResponseValidator
jsonapi.resource_type.repository Drupal\jsonapi\ResourceType\ResourceTypeRepository
jsonapi.route_enhancer Drupal\jsonapi\Routing\RouteEnhancer
jsonapi.serializer_do_not_use_removal_imminent Drupal\jsonapi\Serializer\Serializer
logger.channel.jsonapi
paramconverter.jsonapi.entity_uuid Drupal\jsonapi\ParamConverter\EntityUuidConverter
paramconverter.jsonapi.resource_type Drupal\jsonapi\ParamConverter\ResourceTypeConverter
serializer.encoder.jsonapi Drupal\jsonapi\Encoder\JsonEncoder
serializer.normalizer.config_entity.jsonapi Drupal\jsonapi\Normalizer\ConfigEntityNormalizer
serializer.normalizer.entity.jsonapi Drupal\jsonapi\Normalizer\ContentEntityNormalizer
serializer.normalizer.entity_access_exception.jsonapi Drupal\jsonapi\Normalizer\EntityAccessDeniedHttpExceptionNormalizer
serializer.normalizer.entity_condition.jsonapi Drupal\jsonapi\Normalizer\EntityConditionNormalizer
serializer.normalizer.entity_condition_group.jsonapi Drupal\jsonapi\Normalizer\EntityConditionGroupNormalizer
serializer.normalizer.entity_reference_field.jsonapi Drupal\jsonapi\Normalizer\EntityReferenceFieldNormalizer
serializer.normalizer.entity_reference_item.jsonapi Drupal\jsonapi\Normalizer\RelationshipItemNormalizer
serializer.normalizer.field.jsonapi Drupal\jsonapi\Normalizer\FieldNormalizer
serializer.normalizer.field_item.jsonapi Drupal\jsonapi\Normalizer\FieldItemNormalizer
serializer.normalizer.filter.jsonapi Drupal\jsonapi\Normalizer\FilterNormalizer
serializer.normalizer.http_exception.jsonapi Drupal\jsonapi\Normalizer\HttpExceptionNormalizer
serializer.normalizer.htt_exception.jsonapi Alias of serializer.normalizer.http_exception.jsonapi
serializer.normalizer.jsonapi_document_toplevel.jsonapi Drupal\jsonapi\Normalizer\JsonApiDocumentTopLevelNormalizer
serializer.normalizer.offset_page.jsonapi Drupal\jsonapi\Normalizer\OffsetPageNormalizer
serializer.normalizer.relationship.jsonapi Drupal\jsonapi\Normalizer\RelationshipNormalizer
serializer.normalizer.sort.jsonapi Drupal\jsonapi\Normalizer\SortNormalizer
serializer.normalizer.unprocessable_entity_exception.jsonapi Drupal\jsonapi\Normalizer\UnprocessableHttpEntityExceptionNormalizer