framework:
    secret:                           'dunglas.fr'
    validation:
        enable_annotations:            true
    serializer:
        enable_annotations:            true
    test:                              ~
    session:
        storage_id:                    'session.storage.mock_file'
    form:                              ~ # For FOSUser
    templating:
        engines:                       ['twig'] # For Swagger UI

doctrine:
    dbal:
        driver:                       'pdo_sqlite'
        path:                         '%kernel.cache_dir%/db.sqlite'
        charset:                      'UTF8'
        types:
            uuid:  Ramsey\Uuid\Doctrine\UuidType

    orm:
        auto_generate_proxy_classes:   '%kernel.debug%'
        auto_mapping:                  true

twig:
    strict_variables: '%kernel.debug%'

api_platform:
    title:                             'My Dummy API'
    description:                       'This is a test API.'
    allow_plain_identifiers:           true
    formats:
        jsonld:                        ['application/ld+json']
        jsonhal:                       ['application/hal+json']
        jsonapi:                       ['application/vnd.api+json']
        xml:                           ['application/xml', 'text/xml']
        json:                          ['application/json']
        html:                          ['text/html']
    error_formats:
        jsonproblem:                   ['application/problem+json']
        jsonld:                        ['application/ld+json']
        jsonapi:                       ['application/vnd.api+json']
    graphql:                           true
    name_converter:                    'app.name_converter'
    enable_fos_user:                   true
    collection:
        order_parameter_name:          'order'
        order:                         'ASC'
        pagination:
            client_enabled:            true
            client_items_per_page:     true
            client_partial:            true
            items_per_page:            3
    exception_to_status:
        Symfony\Component\Serializer\Exception\ExceptionInterface: !php/const Symfony\Component\HttpFoundation\Response::HTTP_BAD_REQUEST
        ApiPlatform\Core\Exception\InvalidArgumentException: !php/const Symfony\Component\HttpFoundation\Response::HTTP_BAD_REQUEST
        ApiPlatform\Core\Exception\FilterValidationException: !php/const Symfony\Component\HttpFoundation\Response::HTTP_BAD_REQUEST
    http_cache:
        invalidation:
            enabled: true
        max_age:        60
        shared_max_age: 3600
        vary:           ['Accept', 'Cookie']
        public:         true
    mapping:
        paths: ['%kernel.project_dir%/config/api_platform']

fos_user:
    db_driver:        'orm'
    firewall_name:    'api'
    user_class:       'ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\User'
    from_email:
        address:      'no-reply@les-tilleuls.coop'
        sender_name:  'Kévin Dunglas'

parameters:
    container.autowiring.strict_mode: true
    container.dumper.inline_class_loader: true
    # Enable the metadata cache to speedup the builds
    api_platform.metadata_cache: true

services:
    contain_non_resource.item_data_provider:
        class: 'ApiPlatform\Core\Tests\Fixtures\TestBundle\DataProvider\ContainNonResourceItemDataProvider'
        public: false
        tags:
            -  { name: 'api_platform.item_data_provider' }

    serializable.item_data_provider:
        class: 'ApiPlatform\Core\Tests\Fixtures\TestBundle\DataProvider\SerializableItemDataProvider'
        public: false
        tags:
            -  { name: 'api_platform.item_data_provider' }

    resource_interface.data_provider:
        class: 'ApiPlatform\Core\Tests\Fixtures\TestBundle\DataProvider\ResourceInterfaceImplementationDataProvider'
        public: false
        tags:
            -  { name: 'api_platform.item_data_provider' }
            -  { name: 'api_platform.collection_data_provider' }

    app.serializer.denormalizer.serializable_resource:
        class: 'ApiPlatform\Core\Tests\Fixtures\TestBundle\Serializer\Denormalizer\SerializableResourceDenormalizer'
        public: false
        tags:
            -  { name: 'serializer.normalizer' }

    fos_user.mailer.default:
        class: 'ApiPlatform\Core\Tests\Mock\FosUser\MailerMock'

    app.name_converter:
        class: 'ApiPlatform\Core\Tests\Fixtures\TestBundle\Serializer\NameConverter\CustomConverter'

    app.my_dummy_resource.search_filter:
        parent:    'api_platform.doctrine.orm.search_filter'
        arguments: [ { 'id': 'exact', 'name': 'partial', 'alias': 'start', 'description': 'word_start', 'relatedDummy.name': 'exact', 'relatedDummies': 'exact', 'dummy': 'ipartial', 'relatedDummies.name': 'start', 'embeddedDummy.dummyName': 'partial' } ]
        tags:      [ { name: 'api_platform.filter', id: 'my_dummy.search' } ]

    # Tests if the id default to the service name, do not add id attributes here
    my_dummy.order:
        parent:    'api_platform.doctrine.orm.order_filter'
        arguments: [ { 'id': ~, 'name': 'desc', 'description': ~, 'relatedDummy.name': ~, 'embeddedDummy.dummyName': 'desc', 'relatedDummy.symfony': ~, 'dummyDate': ~} ]
        tags:      [ { name: 'api_platform.filter', id: 'my_dummy.order' } ]

    app.my_dummy_resource.date_filter:
        parent:    'api_platform.doctrine.orm.date_filter'
        arguments: [ { 'dummyDate': ~, 'relatedDummy.dummyDate': ~, 'embeddedDummy.dummyDate': ~ } ]
        tags:      [ { name: 'api_platform.filter', id: 'my_dummy.date' } ]

    app.my_dummy_date_resource.date_filter:
        parent:    'api_platform.doctrine.orm.date_filter'
        arguments: [ { 'dummyDate': ~ } ]
        tags:      [ { name: 'api_platform.filter', id: 'my_dummy_date.date' } ]

    my_dummy_immutable_date.date:
        parent:    'api_platform.doctrine.orm.date_filter'
        arguments: [ { 'dummyDate': ~ } ]
        tags:      [ { name: 'api_platform.filter' } ]

    app.my_dummy_resource.range_filter:
        parent:    'api_platform.doctrine.orm.range_filter'
        arguments: [ { 'dummyFloat': ~, 'dummyPrice': ~ } ]
        tags:      [ { name: 'api_platform.filter', id: 'my_dummy.range' } ]

    app.my_dummy_resource.boolean_filter:
        parent:    'api_platform.doctrine.orm.boolean_filter'
        arguments: [ { 'dummyBoolean': ~, 'embeddedDummy.dummyBoolean': ~, 'relatedDummy.embeddedDummy.dummyBoolean': ~ } ]
        tags:      [ { name: 'api_platform.filter', id: 'my_dummy.boolean' } ]

    app.my_dummy_resource.numeric_filter:
        parent:    'api_platform.doctrine.orm.numeric_filter'
        arguments: [ { 'dummyFloat': ~, 'dummyPrice': ~ } ]
        tags:      [ { name: 'api_platform.filter', id: 'my_dummy.numeric' } ]

    app.my_dummy_resource.exists_filter:
        parent:    'api_platform.doctrine.orm.exists_filter'
        arguments: [ { 'description': ~, 'relatedDummy.name': ~, 'dummyBoolean': ~, 'relatedDummy': ~ } ]
        tags:      [ { name: 'api_platform.filter', id: 'my_dummy.exists' } ]

    app.my_dummy_resource.property_filter:
        parent:    'api_platform.serializer.property_filter'
        tags:      [ { name: 'api_platform.filter', id: 'my_dummy.property' } ]

    ApiPlatform\Core\Tests\Fixtures\TestBundle\Filter\RequiredFilter:
        arguments: ['@doctrine']
        tags: ['api_platform.filter']

    ApiPlatform\Core\Tests\Fixtures\TestBundle\Filter\ArrayRequiredFilter:
        arguments: ['@doctrine']
        tags: ['api_platform.filter']

    app.config_dummy_resource.action:
        class: 'ApiPlatform\Core\Tests\Fixtures\TestBundle\Action\ConfigCustom'
        arguments: ['@api_platform.item_data_provider']
        public: true

    app.entity.filter.dummy_property.property:
        parent:    'api_platform.serializer.property_filter'
        tags:      [ { name: 'api_platform.filter', id: 'dummy_property.property' } ]

    app.entity.filter.dummy_property.whitelist_property:
        parent:    'api_platform.serializer.property_filter'
        arguments: [ 'whitelisted_properties', false, [foo] ]
        tags:      [ { name: 'api_platform.filter', id: 'dummy_property.whitelist_property' } ]

    app.entity.filter.dummy_property.whitelist_nested_property:
        parent:    'api_platform.serializer.property_filter'
        arguments: [ 'whitelisted_nested_properties', false, {foo: ~, group: [baz, qux]} ]
        tags:      [ { name: 'api_platform.filter', id: 'dummy_property.whitelisted_properties' } ]

    app.entity.filter.dummy_group.group:
        parent:    'api_platform.serializer.group_filter'
        tags:      [ { name: 'api_platform.filter', id: 'dummy_group.group' } ]

    app.entity.filter.dummy_group.override_group:
        parent:    'api_platform.serializer.group_filter'
        arguments: [ 'override_groups', true ]
        tags:      [ { name: 'api_platform.filter', id: 'dummy_group.override_group' } ]

    app.entity.filter.dummy_group.whitelist_group:
        parent:    'api_platform.serializer.group_filter'
        arguments: [ 'whitelisted_groups', false, ['dummy_foo', 'dummy_baz'] ]
        tags:      [ { name: 'api_platform.filter', id: 'dummy_group.whitelist_group' } ]

    app.entity.filter.dummy_group.override_whitelist_group:
        parent:    'api_platform.serializer.group_filter'
        arguments: [ 'override_whitelisted_groups', true, ['dummy_foo', 'dummy_baz'] ]
        tags:      [ { name: 'api_platform.filter', id: 'dummy_group.override_whitelist_group' } ]

    app.related_dummy_resource.search_filter:
        parent:    'api_platform.doctrine.orm.search_filter'
        arguments: [ { 'relatedToDummyFriend.dummyFriend': 'exact', 'name': 'partial' } ]
        tags:      [ { name: 'api_platform.filter', id: 'related_dummy.friends' } ]

    app.related_dummy_to_friend_resource.search_filter:
        parent:    'api_platform.doctrine.orm.search_filter'
        arguments: [ { 'name': 'ipartial', 'description': 'ipartial' } ]
        tags:      [ { name: 'api_platform.filter', id: 'related_to_dummy_friend.name' } ]

    logger:
        class: Psr\Log\NullLogger

    api_platform.http_cache.purger:
        class: ApiPlatform\Core\Tests\Fixtures\NullPurger

    test.api_platform.http_cache.purger:
        alias: api_platform.http_cache.purger
        public: true

    test.property_accessor:
        alias: property_accessor
        public: true

    test.annotation_reader:
        alias: annotation_reader
        public: true

    app.dummy_validation.group_generator:
        class: ApiPlatform\Core\Tests\Fixtures\TestBundle\Validator\DummyValidationGroupsGenerator
        public: true
