<?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.openapi.normalizer" class="ApiPlatform\OpenApi\Serializer\OpenApiNormalizer" public="false">
            <argument type="service">
                <service class="Symfony\Component\Serializer\Serializer">
                    <argument type="collection">
                        <argument type="service">
                            <service class="Symfony\Component\Serializer\Normalizer\ObjectNormalizer">
                                <argument>null</argument>
                                <argument>null</argument>
                                <argument type="service" id="api_platform.property_accessor"/>
                                <argument type="service" id="api_platform.property_info"/>
                            </service>
                        </argument>
                    </argument>
                    <argument type="collection">
                        <argument type="service" id="serializer.encoder.json" />
                    </argument>
                </service>
            </argument>

            <!-- Just after the DocumentationNormalizer see swagger.xml -->
            <tag name="serializer.normalizer" priority="-795" />
        </service>
        <service id="ApiPlatform\OpenApi\Serializer\OpenApiNormalizer" alias="api_platform.openapi.normalizer" />

        <service id="api_platform.openapi.options" class="ApiPlatform\OpenApi\Options">
            <argument>%api_platform.title%</argument>
            <argument>%api_platform.description%</argument>
            <argument>%api_platform.version%</argument>
            <argument>%api_platform.oauth.enabled%</argument>
            <argument>%api_platform.oauth.type%</argument>
            <argument>%api_platform.oauth.flow%</argument>
            <argument>%api_platform.oauth.tokenUrl%</argument>
            <argument>%api_platform.oauth.authorizationUrl%</argument>
            <argument>%api_platform.oauth.refreshUrl%</argument>
            <argument>%api_platform.oauth.scopes%</argument>
            <argument>%api_platform.swagger.api_keys%</argument>
            <argument>%api_platform.openapi.contact.name%</argument>
            <argument>%api_platform.openapi.contact.url%</argument>
            <argument>%api_platform.openapi.contact.email%</argument>
            <argument>%api_platform.openapi.termsOfService%</argument>
            <argument>%api_platform.openapi.license.name%</argument>
            <argument>%api_platform.openapi.license.url%</argument>
        </service>
        <service id="ApiPlatform\OpenApi\Options" alias="api_platform.openapi.options" />

        <service id="api_platform.openapi.command" class="ApiPlatform\Symfony\Bundle\Command\OpenApiCommand">
            <argument type="service" id="api_platform.openapi.factory" />
            <argument type="service" id="api_platform.serializer" />
            <tag name="console.command" />
        </service>

        <service id="api_platform.openapi.normalizer.api_gateway"  class="ApiPlatform\OpenApi\Serializer\ApiGatewayNormalizer" public="false" decorates="api_platform.openapi.normalizer" decoration-priority="-1">
            <argument type="service" id="api_platform.openapi.normalizer.api_gateway.inner" />
            <tag name="serializer.normalizer" priority="-780" />
        </service>
        <service id="ApiPlatform\OpenApi\Factory\OpenApiFactoryInterface" alias="api_platform.openapi.factory" />
    </services>

</container>
