Files
Mangarr/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/MangaChaptersResource.php
ext.jeremy.guillot@maxicoffee.domains 7506a7a3c1 style: apply php-cs-fixer formatting (PSR-12)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 20:46:59 +01:00

67 lines
2.2 KiB
PHP

<?php
namespace App\Domain\Manga\Infrastructure\ApiPlatform\Resource;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use App\Domain\Manga\Infrastructure\ApiPlatform\Dto\ChapterCollection;
use App\Domain\Manga\Infrastructure\ApiPlatform\State\Provider\GetMangaChaptersStateProvider;
#[ApiResource(
shortName: 'Chapters',
operations: [
new Get(
uriTemplate: '/mangas/{id}/chapters',
provider: GetMangaChaptersStateProvider::class,
output: ChapterCollection::class,
openapiContext: [
'parameters' => [
[
'name' => 'id',
'in' => 'path',
'required' => true,
'schema' => [
'type' => 'string'
],
'description' => 'The manga identifier'
],
[
'name' => 'page',
'in' => 'query',
'required' => false,
'schema' => [
'type' => 'integer',
'default' => 1
],
'description' => 'The page number'
],
[
'name' => 'limit',
'in' => 'query',
'required' => false,
'schema' => [
'type' => 'integer',
'default' => 20
],
'description' => 'Number of items per page'
],
[
'name' => 'sortOrder',
'in' => 'query',
'required' => false,
'schema' => [
'type' => 'string',
'enum' => ['asc', 'desc'],
'default' => 'desc'
],
'description' => 'Sort order for chapters'
]
]
]
)
]
)]
class MangaChaptersResource
{
}