diff --git a/docs/guides/create-a-custom-doctrine-filter.php b/docs/guides/create-a-custom-doctrine-filter.php index f06c4d8bfce..ec66b21368e 100644 --- a/docs/guides/create-a-custom-doctrine-filter.php +++ b/docs/guides/create-a-custom-doctrine-filter.php @@ -11,11 +11,11 @@ // // API Platform provides a convenient way to create Doctrine ORM and MongoDB ODM filters. If you use [custom state providers](/docs/guide/state-providers), you can still create filters by implementing the previously mentioned interface, but - as API Platform isn't aware of your persistence system's internals - you have to create the filtering logic by yourself. // -// Doctrine ORM filters have access to the context created from the HTTP request and to the `QueryBuilder` instance used to retrieve data from the database. They are only applied to collections. If you want to deal with the DQL query generated to retrieve items, [extensions](/docs/in-depth/extensions) are the way to go. +// Doctrine ORM filters have access to the context created from the HTTP request and to the `QueryBuilder` instance used to retrieve data from the database. They are only applied to collections. If you want to deal with the DQL query generated to retrieve items, [extensions](/docs/core/extensions/) are the way to go. // // A Doctrine ORM filter is basically a class implementing the `ApiPlatform\Doctrine\Orm\Filter\FilterInterface`. API Platform includes a convenient abstract class implementing this interface and providing utility methods: `ApiPlatform\Doctrine\Orm\Filter\AbstractFilter`. // -// Note: Doctrine MongoDB ODM filters have access to the context created from the HTTP request and to the [aggregation builder](https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/reference/aggregation-builder.html) instance used to retrieve data from the database and to execute [complex operations on data](https://docs.mongodb.com/manual/aggregation/). They are only applied to collections. If you want to deal with the aggregation pipeline generated to retrieve items, [extensions](/docs/in-depth/extensions) are the way to go. +// Note: Doctrine MongoDB ODM filters have access to the context created from the HTTP request and to the [aggregation builder](https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/reference/aggregation-builder.html) instance used to retrieve data from the database and to execute [complex operations on data](https://docs.mongodb.com/manual/aggregation/). They are only applied to collections. If you want to deal with the aggregation pipeline generated to retrieve items, [extensions](/docs/core/extensions/) are the way to go. // // A Doctrine MongoDB ODM filter is basically a class implementing the `ApiPlatform\Doctrine\Odm\Filter\FilterInterface`. API Platform includes a convenient abstract class implementing this interface and providing utility methods: `ApiPlatform\Doctrine\Odm\Filter\AbstractFilter`. // diff --git a/docs/guides/declare-a-resource.php b/docs/guides/declare-a-resource.php index f7b49c0a54a..c741ea06bae 100644 --- a/docs/guides/declare-a-resource.php +++ b/docs/guides/declare-a-resource.php @@ -46,7 +46,7 @@ class Book } } -// Check our next guide to [provide the resource state](./provide-the-resource-state). +// Check our next guide to [provide the resource state](/playground/provide-the-resource-state). namespace App\Playground { use Symfony\Component\HttpFoundation\Request; diff --git a/docs/guides/doctrine-entity-as-resource.php b/docs/guides/doctrine-entity-as-resource.php index e35a56afca8..343b57f922c 100644 --- a/docs/guides/doctrine-entity-as-resource.php +++ b/docs/guides/doctrine-entity-as-resource.php @@ -17,7 +17,7 @@ use ApiPlatform\Metadata\ApiResource; use Doctrine\ORM\Mapping as ORM; - // When an ApiResource is declared on an `\ORM\Entity` we have access to [Doctrine filters](https://api-platform.com/docs/core/filters/). + // When an ApiResource is declared on an `\ORM\Entity` we have access to [Doctrine filters](/docs/core/filters/). #[ApiResource] #[ApiFilter(OrderFilter::class)] #[ORM\Entity] diff --git a/docs/guides/extend-openapi-documentation.php b/docs/guides/extend-openapi-documentation.php index 6ce243decbd..cd1ddbd4b9a 100644 --- a/docs/guides/extend-openapi-documentation.php +++ b/docs/guides/extend-openapi-documentation.php @@ -7,6 +7,7 @@ // tags: openapi, expert // --- +// # Extend OpenAPI Documentation namespace App\ApiResource { use ApiPlatform\Metadata\Post; use ApiPlatform\OpenApi\Model\Operation; @@ -14,12 +15,15 @@ use ApiPlatform\OpenApi\Model\Response; #[Post( + // To extend the OpenAPI documentation we use an [OpenApi Operation model](/docs/reference/OpenApi/Model/Operation/). + // When a field is not specified API Platform will add the missing informations. openapi: new Operation( responses: [ '200' => new Response(description: 'Ok'), ], summary: 'Add a book to the library.', description: 'My awesome operation', + // Each of the Operation field that you want to customize has a model in our [OpenApi reference](/docs/reference/). requestBody: new RequestBody( content: new \ArrayObject( [ diff --git a/docs/guides/hook-a-persistence-layer-with-a-processor.php b/docs/guides/hook-a-persistence-layer-with-a-processor.php index f7d8225a8c7..0c689b56188 100644 --- a/docs/guides/hook-a-persistence-layer-with-a-processor.php +++ b/docs/guides/hook-a-persistence-layer-with-a-processor.php @@ -14,7 +14,7 @@ use App\State\BookProcessor; use App\State\BookProvider; - // We use a `BookProcessor` as the [ApiResource::processor](http://localhost:3000/reference/Metadata/ApiResource#processor) option. + // We use a `BookProcessor` as the [ApiResource::processor](/docs/reference/Metadata/ApiResource#processor) option. #[ApiResource(processor: BookProcessor::class, provider: BookProvider::class)] class Book { diff --git a/docs/guides/provide-the-resource-state.php b/docs/guides/provide-the-resource-state.php index 9dfa1be0185..675fb3c5c7e 100644 --- a/docs/guides/provide-the-resource-state.php +++ b/docs/guides/provide-the-resource-state.php @@ -8,14 +8,14 @@ // --- // # Provide the Resource State -// Our model is the same then in the previous guide ([Declare a Resource](./declare-a-resource). API Platform will declare +// Our model is the same then in the previous guide ([Declare a Resource](/playground/declare-a-resource). API Platform will declare // CRUD operations if we don't declare them. namespace App\ApiResource { use ApiPlatform\Metadata\ApiResource; use App\State\BookProvider; - // We use a `BookProvider` as the [ApiResource::provider](/reference/Metadata/ApiResource#provider) option. + // We use a `BookProvider` as the [ApiResource::provider](/docs/reference/Metadata/ApiResource#provider) option. #[ApiResource(provider: BookProvider::class)] class Book { @@ -39,14 +39,14 @@ public function provide(Operation $operation, array $uriVariables = [], array $c $book = new Book(); $book->id = '1'; - // $book2 = new Book(); - // $book2->id = '2'; + /** $book2 = new Book(); + $book2->id = '2'; */ // As an exercise you can edit the code and add a second book in the collection. return [$book/* $book2 */]; } $book = new Book(); - // The value at `$uriVariables['id']` is the one that matches the `{id}` variable of the **[URI template](/explanation/uri#uri-template)**. + // The value at `$uriVariables['id']` is the one that matches the `{id}` variable of the **[URI template](/docs/core/subresources/)**. $book->id = $uriVariables['id']; return $book;