<?php

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

use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use ApiPlatform\OpenApi\Model\Operation;
use ApiPlatform\OpenApi\Model\Parameter;
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',
            openapi: new Operation(
                parameters: [
                    new Parameter(
                        name: 'title',
                        in: 'query',
                        required: true,
                        schema: ['type' => 'string'],
                        description: 'The title to search for'
                    ),
                ]
            ),
            output: MangaSearchCollection::class,
            provider: SearchMangaStateProvider::class
        ),
    ]
)]
class MangaSearchResource
{
}
