Skip to main content

GET Endpoint

src/ApiResource/Admin/BookDto.php
namespace App\ApiResource\Admin;

use App\ApiState\Admin\Book\BookProvider;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;

#[ApiResource(
shortName: 'Admin/Book',
routePrefix: '/admin',
operations: [
// ...
new Get(
uriTemplate: '/books/{id}',
provider: BookProvider::class,
),
// ...
]
)]
class BookDto
{
// ...
}