<?php

namespace App\Domain\Manga\Infrastructure\ApiPlatform\Resource;

use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use App\Domain\Manga\Infrastructure\ApiPlatform\Dto\MangaSearchCollection;
use App\Domain\Manga\Infrastructure\ApiPlatform\State\Provider\SearchMangaStateProvider;

#[ApiResource(
    shortName: 'Mangadex',
    operations: [
        new Get(
            uriTemplate: '/mangadex-search',
            openapiContext: [
                'parameters' => [
                    [
                        'name' => 'title',
                        'in' => 'query',
                        'required' => true,
                        'schema' => [
                            'type' => 'string'
                        ],
                        'description' => 'The title to search for'
                    ]
                ]
            ],
            output: MangaSearchCollection::class,
            provider: SearchMangaStateProvider::class
        )
    ]
)]
class MangaSearchResource
{
}
