fix(bookstack) : add uriVariables to BookStackLink and BookStackSearchResult
API Platform 4 requires explicit uriVariables declaration for URI template parameters on DTO resources. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,10 @@ namespace App\ApiResource;
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
use ApiPlatform\Metadata\Delete;
|
||||
use ApiPlatform\Metadata\GetCollection;
|
||||
use ApiPlatform\Metadata\Link;
|
||||
use ApiPlatform\Metadata\Post;
|
||||
use App\Entity\Task;
|
||||
use App\Entity\TaskBookStackLink;
|
||||
use App\State\BookStackLinkProcessor;
|
||||
use App\State\BookStackLinkProvider;
|
||||
use Symfony\Component\Serializer\Attribute\Groups;
|
||||
@@ -16,12 +19,18 @@ use Symfony\Component\Serializer\Attribute\Groups;
|
||||
operations: [
|
||||
new GetCollection(
|
||||
uriTemplate: '/tasks/{taskId}/bookstack/links',
|
||||
uriVariables: [
|
||||
'taskId' => new Link(fromClass: Task::class, identifiers: ['id']),
|
||||
],
|
||||
normalizationContext: ['groups' => ['bookstack_link:read']],
|
||||
provider: BookStackLinkProvider::class,
|
||||
security: "is_granted('IS_AUTHENTICATED_FULLY')",
|
||||
),
|
||||
new Post(
|
||||
uriTemplate: '/tasks/{taskId}/bookstack/links',
|
||||
uriVariables: [
|
||||
'taskId' => new Link(fromClass: Task::class, identifiers: ['id']),
|
||||
],
|
||||
denormalizationContext: ['groups' => ['bookstack_link:write']],
|
||||
normalizationContext: ['groups' => ['bookstack_link:read']],
|
||||
provider: BookStackLinkProvider::class,
|
||||
@@ -30,6 +39,10 @@ use Symfony\Component\Serializer\Attribute\Groups;
|
||||
),
|
||||
new Delete(
|
||||
uriTemplate: '/tasks/{taskId}/bookstack/links/{id}',
|
||||
uriVariables: [
|
||||
'taskId' => new Link(fromClass: Task::class, identifiers: ['id']),
|
||||
'id' => new Link(fromClass: TaskBookStackLink::class, identifiers: ['id']),
|
||||
],
|
||||
provider: BookStackLinkProvider::class,
|
||||
processor: BookStackLinkProcessor::class,
|
||||
security: "is_granted('IS_AUTHENTICATED_FULLY')",
|
||||
|
||||
@@ -6,6 +6,8 @@ namespace App\ApiResource;
|
||||
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
use ApiPlatform\Metadata\GetCollection;
|
||||
use ApiPlatform\Metadata\Link;
|
||||
use App\Entity\Task;
|
||||
use App\State\BookStackSearchResultProvider;
|
||||
use Symfony\Component\Serializer\Attribute\Groups;
|
||||
|
||||
@@ -13,6 +15,9 @@ use Symfony\Component\Serializer\Attribute\Groups;
|
||||
operations: [
|
||||
new GetCollection(
|
||||
uriTemplate: '/tasks/{taskId}/bookstack/search',
|
||||
uriVariables: [
|
||||
'taskId' => new Link(fromClass: Task::class, identifiers: ['id']),
|
||||
],
|
||||
normalizationContext: ['groups' => ['bookstack_search:read']],
|
||||
provider: BookStackSearchResultProvider::class,
|
||||
security: "is_granted('IS_AUTHENTICATED_FULLY')",
|
||||
|
||||
Reference in New Issue
Block a user