diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 6a25f68ee..a56eef9ef 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -52,6 +52,8 @@ parameters: # To disable set to 0. ezsystems.platformui.application_config.combo_loader.cache_ttl: 604800 + ezsystems.platformui.rest.generator.json.vendor: 'vnd.ez.platformui' + ezsystems.platformui.rest.output.visitor.json.regexps: - '(^application/vnd\.ez\.platformui\.[A-Za-z]+\+json$)' services: @@ -282,9 +284,10 @@ services: - { name: ezpublish_rest.field_type_processor, alias: ezuser } ezsystems.platformui.rest.output.generator.json: - class: EzSystems\PlatformUIBundle\Rest\Generator\Json + class: eZ\Publish\Core\REST\Common\Output\Generator\Json arguments: - "@ezpublish_rest.output.generator.json.field_type_hash_generator" + - "%ezsystems.platformui.rest.generator.json.vendor%" calls: - [ setFormatOutput, [ "%kernel.debug%" ] ] diff --git a/Rest/Generator/Json.php b/Rest/Generator/Json.php deleted file mode 100644 index 82eddb05c..000000000 --- a/Rest/Generator/Json.php +++ /dev/null @@ -1,17 +0,0 @@ -getMock(FieldTypeHashGenerator::class)))->getMediaType('Object'); + $vendor = 'vnd.ez.platformui'; + $mediaType = (new Json($this->getMock(FieldTypeHashGenerator::class), $vendor))->getMediaType('Object'); $this->assertEquals('application/vnd.ez.platformui.Object+json', $mediaType); }