<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <services>
        <service id="api_platform.jsonld.context_builder" class="ApiPlatform\JsonLd\ContextBuilder" public="false">
            <argument type="service" id="api_platform.metadata.resource.name_collection_factory" />
            <argument type="service" id="api_platform.metadata.resource.metadata_collection_factory" />
            <argument type="service" id="api_platform.metadata.property.name_collection_factory" />
            <argument type="service" id="api_platform.metadata.property.metadata_factory" />
            <argument type="service" id="api_platform.router" />
            <argument type="service" id="api_platform.symfony.iri_converter.skolem" />
            <argument type="service" id="api_platform.name_converter"/>
            <argument>%api_platform.serializer.default_context%</argument>
        </service>

        <!-- Serializer -->

        <service id="api_platform.jsonld.normalizer.item" class="ApiPlatform\JsonLd\Serializer\ItemNormalizer" public="false">
            <argument type="service" id="api_platform.metadata.resource.metadata_collection_factory" />
            <argument type="service" id="api_platform.metadata.property.name_collection_factory" />
            <argument type="service" id="api_platform.metadata.property.metadata_factory" />
            <argument type="service" id="api_platform.iri_converter" />
            <argument type="service" id="api_platform.resource_class_resolver" />
            <argument type="service" id="api_platform.jsonld.context_builder" />
            <argument type="service" id="api_platform.property_accessor" />
            <argument type="service" id="api_platform.name_converter" on-invalid="ignore" />
            <argument type="service" id="serializer.mapping.class_metadata_factory" on-invalid="ignore" />
            <argument>%api_platform.serializer.default_context%</argument>
            <argument type="service" id="api_platform.security.resource_access_checker" on-invalid="ignore" />
            <argument type="service" id="api_platform.http_cache.tag_collector" on-invalid="ignore" />

            <!-- Run before serializer.normalizer.json_serializable -->
            <tag name="serializer.normalizer" priority="-890" />
        </service>

        <service id="api_platform.jsonld.normalizer.error" class="ApiPlatform\JsonLd\Serializer\ErrorNormalizer" public="false">
            <argument type="service" id="api_platform.jsonld.normalizer.item" />
            <argument>%api_platform.serializer.default_context%</argument>
            <tag name="serializer.normalizer" priority="-880" />
        </service>

        <service id="api_platform.jsonld.normalizer.object" class="ApiPlatform\JsonLd\Serializer\ObjectNormalizer" public="false">
            <argument type="service" id="serializer.normalizer.object" />
            <argument type="service" id="api_platform.iri_converter" />
            <argument type="service" id="api_platform.jsonld.context_builder" />

            <!-- Run after serializer.denormalizer.array but before serializer.normalizer.object -->
            <tag name="serializer.normalizer" priority="-995" />
        </service>

        <service id="api_platform.jsonld.normalizer.validation_exception" class="ApiPlatform\Symfony\Validator\Serializer\ValidationExceptionNormalizer" public="false">
            <argument type="service" id="api_platform.jsonld.normalizer.error" />
            <argument type="service" id="api_platform.name_converter" on-invalid="ignore" />

            <tag name="serializer.normalizer" priority="-800" />
        </service>

        <service id="api_platform.jsonld.encoder" class="ApiPlatform\Serializer\JsonEncoder" public="false">
            <argument>jsonld</argument>
            <argument type="service" id="serializer.json.encoder" on-invalid="null" />

            <tag name="serializer.encoder" />
        </service>
    </services>

</container>
