You are here

schemata_json_schema.services.yml in Schemata 8

schemata_json_schema/schemata_json_schema.services.yml

File

schemata_json_schema/schemata_json_schema.services.yml
View source
  1. services:
  2. serializer.encoder.json_schema.json:
  3. class: Drupal\schemata_json_schema\Encoder\JsonSchemaEncoder
  4. arguments: ['@serializer.encoder.json']
  5. tags:
  6. - { name: encoder, priority: 10, format: 'schema_json:json' }
  7. # ----------------------------------------------------------------------------
  8. # - NORMALIZERS for each format.
  9. # ----------------------------------------------------------------------------
  10. # - 1. JSON format.
  11. # ----------------------------------------------------------------------------
  12. # References should be converted to other schema resources for the type.
  13. # This priority ensures the DataReferenceDefinition is handled before
  14. # DataDefinition. Since it is orthogonal to ComplexDataDefinition, they share
  15. # the same priority.
  16. serializer.normalizer.data_reference_definition.schema_json.json:
  17. class: Drupal\schemata_json_schema\Normalizer\json\DataReferenceDefinitionNormalizer
  18. arguments: ['@entity_type.manager']
  19. tags:
  20. - { name: normalizer, priority: 25 }
  21. # Normalize complex data properties.
  22. # This priority ensures the ComplexDataDefinition is handled before
  23. # DataDefinition. Since it is orthagonal to DataReferenceDefinition, they
  24. # share the same priority.
  25. serializer.normalizer.complex_data_definition.schema_json.json:
  26. class: Drupal\schemata_json_schema\Normalizer\json\ComplexDataDefinitionNormalizer
  27. tags:
  28. - { name: normalizer, priority: 20 }
  29. # Field definitions are a variant of List definitions, with additional access
  30. # to the particular schema and configuration pieces from the field system. As
  31. # a subclass of ListDataDefinitionInterface, FieldDefinitionInterface needs a
  32. # higher priority.
  33. serializer.normalizer.field_definition.schema_json.json:
  34. class: Drupal\schemata_json_schema\Normalizer\json\FieldDefinitionNormalizer
  35. tags:
  36. - { name: normalizer, priority: 30 }
  37. # If the typed data definition is a list (as most are somewhere along the
  38. # property hierarchy) this triggers the recursion to the next layer.
  39. serializer.normalizer.list_data_definition.schema_json.json:
  40. class: Drupal\schemata_json_schema\Normalizer\json\ListDataDefinitionNormalizer
  41. tags:
  42. - { name: normalizer, priority: 20 }
  43. # Typed data definitions in general can take many forms. This handles final items.
  44. serializer.normalizer.data_definition.schema_json.json:
  45. class: Drupal\schemata_json_schema\Normalizer\json\DataDefinitionNormalizer
  46. tags:
  47. - { name: normalizer, priority: 10 }
  48. # This is the main JSON Schema normalizer.
  49. serializer.normalizer.schema.schema_json.json:
  50. class: Drupal\schemata_json_schema\Normalizer\json\SchemataSchemaNormalizer
  51. tags:
  52. - { name: normalizer, priority: 10 }
  53. # ----------------------------------------------------------------------------
  54. # - 2. JSON API format.
  55. # ----------------------------------------------------------------------------
  56. serializer.normalizer.complex_data_definition.schema_json.jsonapi:
  57. class: Drupal\schemata_json_schema\Normalizer\jsonapi\ComplexDataDefinitionNormalizer
  58. tags:
  59. - { name: normalizer, priority: 20 }
  60. serializer.normalizer.field_definition.schema_json.jsonapi:
  61. class: Drupal\schemata_json_schema\Normalizer\jsonapi\FieldDefinitionNormalizer
  62. tags:
  63. - { name: normalizer, priority: 30 }
  64. serializer.normalizer.relationship_field_definition.schema_json.jsonapi:
  65. class: Drupal\schemata_json_schema\Normalizer\jsonapi\RelationshipFieldDefinitionNormalizer
  66. arguments: ['@plugin.manager.field.field_type']
  67. tags:
  68. - { name: normalizer, priority: 35 }
  69. serializer.normalizer.list_data_definition.schema_json.jsonapi:
  70. class: Drupal\schemata_json_schema\Normalizer\jsonapi\ListDataDefinitionNormalizer
  71. tags:
  72. - { name: normalizer, priority: 20 }
  73. serializer.normalizer.data_definition.schema_json.jsonapi:
  74. class: Drupal\schemata_json_schema\Normalizer\jsonapi\DataDefinitionNormalizer
  75. tags:
  76. - { name: normalizer, priority: 10 }
  77. serializer.normalizer.schema.schema_json.jsonapi:
  78. class: Drupal\schemata_json_schema\Normalizer\jsonapi\SchemataSchemaNormalizer
  79. tags:
  80. - { name: normalizer, priority: 10 }
  81. # ----------------------------------------------------------------------------
  82. # - 3. HAL+JSON format.
  83. # ----------------------------------------------------------------------------
  84. # Note: The HAL+JSON version of the Data Reference normalizer depends on the
  85. # HAL module and is in registered in SchemataJsonSchemaServiceProvider.
  86. # Normalize complex data properties for HAL.
  87. # This services is primarily used to short-circuit merging normalization of
  88. # data references to the schema root.
  89. serializer.normalizer.complex_data_definition.schema_json.hal_json:
  90. class: Drupal\schemata_json_schema\Normalizer\hal\ComplexDataDefinitionNormalizer
  91. tags:
  92. - { name: normalizer, priority: 25 }
  93. # HAL version of FieldDefinition.
  94. # This services is primarily used to short-circuit merging normalization of
  95. # data references to the schema root.
  96. serializer.normalizer.field_definition.schema_json.hal_json:
  97. class: Drupal\schemata_json_schema\Normalizer\hal\FieldDefinitionNormalizer
  98. tags:
  99. - { name: normalizer, priority: 35 }
  100. # HAL version of the ListDataDefinition.
  101. # This services is primarily used to short-circuit merging normalization of
  102. # data references to the schema root.
  103. serializer.normalizer.list_data_definition.schema_json.hal_json:
  104. class: Drupal\schemata_json_schema\Normalizer\hal\ListDataDefinitionNormalizer
  105. tags:
  106. - { name: normalizer, priority: 25 }
  107. serializer.normalizer.schema.schema_json.hal_json:
  108. class: Drupal\schemata_json_schema\Normalizer\hal\SchemataSchemaNormalizer
  109. tags:
  110. - { name: normalizer, priority: 15 }
  111. serializer.normalizer.data_definition.schema_json.hal_json:
  112. class: Drupal\schemata_json_schema\Normalizer\hal\DataDefinitionNormalizer
  113. tags:
  114. - { name: normalizer, priority: 10 }
  115. plugin.manager.schemata_json_schema.type_mapper:
  116. class: Drupal\schemata_json_schema\Plugin\Type\TypeMapperPluginManager
  117. arguments: ['@container.namespaces', '@module_handler']

Services

Namesort descending Description
plugin.manager.schemata_json_schema.type_mapper Drupal\schemata_json_schema\Plugin\Type\TypeMapperPluginManager
serializer.encoder.json_schema.json Drupal\schemata_json_schema\Encoder\JsonSchemaEncoder
serializer.normalizer.complex_data_definition.schema_json.hal_json Drupal\schemata_json_schema\Normalizer\hal\ComplexDataDefinitionNormalizer
serializer.normalizer.complex_data_definition.schema_json.json Drupal\schemata_json_schema\Normalizer\json\ComplexDataDefinitionNormalizer
serializer.normalizer.complex_data_definition.schema_json.jsonapi Drupal\schemata_json_schema\Normalizer\jsonapi\ComplexDataDefinitionNormalizer
serializer.normalizer.data_definition.schema_json.hal_json Drupal\schemata_json_schema\Normalizer\hal\DataDefinitionNormalizer
serializer.normalizer.data_definition.schema_json.json Drupal\schemata_json_schema\Normalizer\json\DataDefinitionNormalizer
serializer.normalizer.data_definition.schema_json.jsonapi Drupal\schemata_json_schema\Normalizer\jsonapi\DataDefinitionNormalizer
serializer.normalizer.data_reference_definition.schema_json.json Drupal\schemata_json_schema\Normalizer\json\DataReferenceDefinitionNormalizer
serializer.normalizer.field_definition.schema_json.hal_json Drupal\schemata_json_schema\Normalizer\hal\FieldDefinitionNormalizer
serializer.normalizer.field_definition.schema_json.json Drupal\schemata_json_schema\Normalizer\json\FieldDefinitionNormalizer
serializer.normalizer.field_definition.schema_json.jsonapi Drupal\schemata_json_schema\Normalizer\jsonapi\FieldDefinitionNormalizer
serializer.normalizer.list_data_definition.schema_json.hal_json Drupal\schemata_json_schema\Normalizer\hal\ListDataDefinitionNormalizer
serializer.normalizer.list_data_definition.schema_json.json Drupal\schemata_json_schema\Normalizer\json\ListDataDefinitionNormalizer
serializer.normalizer.list_data_definition.schema_json.jsonapi Drupal\schemata_json_schema\Normalizer\jsonapi\ListDataDefinitionNormalizer
serializer.normalizer.relationship_field_definition.schema_json.jsonapi Drupal\schemata_json_schema\Normalizer\jsonapi\RelationshipFieldDefinitionNormalizer
serializer.normalizer.schema.schema_json.hal_json Drupal\schemata_json_schema\Normalizer\hal\SchemataSchemaNormalizer
serializer.normalizer.schema.schema_json.json Drupal\schemata_json_schema\Normalizer\json\SchemataSchemaNormalizer
serializer.normalizer.schema.schema_json.jsonapi Drupal\schemata_json_schema\Normalizer\jsonapi\SchemataSchemaNormalizer