Skip to content

Commit 1e3461e

Browse files
docs: fix links and update outline (#2103)
1 parent 53a00ca commit 1e3461e

File tree

9 files changed

+24
-23
lines changed

9 files changed

+24
-23
lines changed

core/dto.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Using Data Transfer Objects (DTOs)
22

3-
<p class="symfonycasts" style="text-align: center;"><a href="https://symfonycasts.com/api-platform-extending?cid=apip"><img src="../symfony/images/symfonycasts-player.png" alt="Custom Resources screencast"><br>Watch the Custom Resources screencast</a></p>
3+
<p class="symfonycasts" align="center"><a href="https://symfonycasts.com/api-platform-extending?cid=apip"><img src="../symfony/images/symfonycasts-player.png" alt="Custom Resources screencast"><br>Watch the Custom Resources screencast</a></p>
44

55
As stated in [the general design considerations](design.md), in most cases [the DTO pattern](https://en.wikipedia.org/wiki/Data_transfer_object) should be implemented using an API Resource class representing the public data model exposed through the API and [a custom State Provider](state-providers.md). In such cases, the class marked with `#[ApiResource]` will act as a DTO.
66

core/extending.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ The following tables summarizes which extension point to use depending on what y
1414
| [Laravel Policies](../laravel/security.md#policies) | custom authorization logic |
1515
| [Validation constraints](validation.md) | custom validation logic |
1616
| [State Processors](state-processors) | custom business logic and computations to trigger before or after persistence (ex: mail, call to an external API...) |
17-
| [Normalizers](serialization.md#decorating-a-serializer-and-adding-extra-data) | customize the resource sent to the client (add fields in JSON documents, encode codes, dates...) |
17+
| [Normalizers](serialization.md#changing-the-serialization-context-dynamically) | customize the resource sent to the client (add fields in JSON documents, encode codes, dates...) |
1818
| [Filters](filters.md) | create filters for collections and automatically document them (OpenAPI, GraphQL, Hydra) |
1919
| [Serializer Context Builders](serialization.md#changing-the-serialization-context-dynamically) | change the Serialization context (e.g. groups) dynamically |
20-
| [Messenger Handlers](../symfony/messenger.md) | create 100% custom, RPC, async, service-oriented endpoints (should be used in place of custom controllers because the messenger integration is compatible with both REST and GraphQL, while custom controllers only work with REST) |
20+
| [Messenger Handlers](../symfony/messenger.md) | create 100% custom, RPC, async, service-oriented endpoints (should be used in place of custom controllers because the messenger integration is compatible with both REST and GraphQL, while custom controllers only work with REST) |
2121
| [DTOs](dto.md) | use a specific class to represent the input or output data structure related to an operation |
2222
| [Kernel Events](events.md) | customize the HTTP request or response (REST only, other extension points must be preferred when possible) |
2323

core/serialization.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ documentation generator.
192192

193193
## Using Serialization Groups per Operation
194194

195-
<p align="center" class="symfonycasts"><a href="https://symfonycasts.com/screencast/api-platform/relations?cid=apip"><img src="../symfony/images/symfonycasts-player.png" alt="Relations screencast"><br>Watch the Relations screencast</a></p>
195+
<p class="symfonycasts" align="center"><a href="https://symfonycasts.com/screencast/api-platform/relations?cid=apip"><img src="../symfony/images/symfonycasts-player.png" alt="Relations screencast"><br>Watch the Relations screencast</a></p>
196196

197197
By default, the serializer provided with API Platform represents relations between objects using [dereferenceable IRIs](https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier).
198198
They allow you to retrieve details for related objects by issuing extra HTTP requests. However, for performance reasons,
@@ -239,6 +239,7 @@ App\ApiResource\Book:
239239
normalizationContext:
240240
groups: ['get']
241241
operations:
242+
ApiPlatform\Metadata\Get: ~
242243
ApiPlatform\Metadata\Get: ~
243244
ApiPlatform\Metadata\Patch:
244245
normalizationContext:

outline.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ chapters:
99
- testing
1010
- debugging
1111
- caddy
12-
- migrate-from-fosrestbundle
13-
- fosuser-bundle
14-
- nelmio-api-doc
15-
- user
1612
- jwt
13+
- messenger
14+
- user
1715
- file-upload
1816
- controllers
19-
- messenger
17+
- nelmio-api-doc
18+
- migrate-from-fosrestbundle
19+
- fosuser-bundle
2020
- title: "API Platform for Laravel"
2121
path: laravel
2222
items:

symfony/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ API Platform is shipped with **[Docker](../deployment/docker-compose.md)** and *
1919
The easiest and most powerful way to get started is [to download the API Platform distribution](https://github.com/api-platform/api-platform/releases). It contains:
2020

2121
- the API skeleton, including [the Core library](../core/index.md), [the Symfony framework](https://symfony.com/) ([optional](../core/bootstrap.md)) and [the Doctrine ORM](https://www.doctrine-project.org/projects/orm.html) ([optional](../core/extending.md))
22-
- [the client scaffolding tool](../create-client/) to generate [Next.js](../create-client/) web applications from the API documentation ([Nuxt](https://nuxt.com/), [Vue](https://vuejs.org/), [Create React App](https://reactjs.org), [React Native](https://reactnative.dev/), [Quasar](https://quasar.dev/) and [Vuetify](https://vuetifyjs.com/) are also supported)
23-
- [a beautiful admin interface](../admin/), built on top of React Admin, dynamically created by parsing the API documentation
22+
- [the client scaffolding tool](../create-client/index.md) to generate [Next.js](../create-client/index.md) web applications from the API documentation ([Nuxt](https://nuxt.com/), [Vue](https://vuejs.org/), [Create React App](https://reactjs.org), [React Native](https://reactnative.dev/), [Quasar](https://quasar.dev/) and [Vuetify](https://vuetifyjs.com/) are also supported)
23+
- [a beautiful admin interface](../admin/index.md), built on top of React Admin, dynamically created by parsing the API documentation
2424
- all you need to [create real-time and async APIs using the Mercure protocol](../core/mercure.md)
2525
- a [Docker](../deployment/docker-compose.md) definition to start a working development environment in a single command, providing containers for the API and the Next.js web application
2626
- a [Helm](https://helm.sh/) chart to deploy the API in any [Kubernetes](../deployment/kubernetes.md) cluster

symfony/jwt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
> **we recommend adopting open standards such as [OpenID Connect (OIDC)](https://openid.net/connect/)** for robust, scalable,
66
> and interoperable authentication.
77
8-
<p align="center" class="symfonycasts"><a href="https://symfonycasts.com/screencast/symfony-rest4/json-web-token?cid=apip"><img src="../symfony/images/symfonycasts-player.png" alt="JWT screencast"><br>Watch the LexikJWTAuthenticationBundle screencast</a></p>
8+
<p class="symfonycasts" align="center"><a href="https://symfonycasts.com/screencast/symfony-rest4/json-web-token?cid=apip"><img src="../symfony/images/symfonycasts-player.png" alt="JWT screencast"><br>Watch the LexikJWTAuthenticationBundle screencast</a></p>
99

1010
## Installing LexikJWTAuthenticationBundle
1111

symfony/security.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ Available variables are:
110110
- `previous_object`: (`securityPostDenormalize` only) a clone of `object`, before modifications were made - this is `null` for create operations
111111
- `request` (only at the resource level): the current request
112112

113-
Access control checks in the `security` attribute are always executed before the [denormalization step](serialization.md).
114-
It means that for `PUT` or `PATCH` requests, `object` doesn't contain the value submitted by the user, but values currently stored in [the persistence layer](state-processors.md).
113+
Access control checks in the `security` attribute are always executed before the [denormalization step](../core/serialization.md).
114+
It means that for `PUT` or `PATCH` requests, `object` doesn't contain the value submitted by the user, but values currently stored in [the persistence layer](../core/state-processors.md).
115115

116116
## Executing Access Control Rules After Denormalization
117117

@@ -337,17 +337,17 @@ resources:
337337

338338
## Filtering Collection According to the Current User Permissions
339339

340-
Filtering collections according to the role or permissions of the current user must be done directly at [the state provider](state-providers.md) level. For instance, when using the built-in adapters for Doctrine ORM, MongoDB and ElasticSearch, removing entries from a collection should be done using [extensions](extensions.md).
340+
Filtering collections according to the role or permissions of the current user must be done directly at [the state provider](../core/state-providers.md) level. For instance, when using the built-in adapters for Doctrine ORM, MongoDB and ElasticSearch, removing entries from a collection should be done using [extensions](../core/extensions.md).
341341
Extensions allow to customize the generated DQL/Mongo/Elastic/... query used to retrieve the collection (e.g. add `WHERE` clauses depending of the currently connected user) instead of using access control expressions.
342342
As extensions are services, you can [inject the Symfony `Security` class](https://symfony.com/doc/current/security.html#b-fetching-the-user-from-a-service) into them to access to current user's roles and permissions.
343343

344-
If you use [custom state providers](state-providers.md), you'll have to implement the filtering logic according to the persistence layer you rely on.
344+
If you use [custom state providers](../core/state-providers.md), you'll have to implement the filtering logic according to the persistence layer you rely on.
345345

346346
## Disabling Operations
347347

348-
To completely disable some operations from your application, refer to the [disabling operations](operations.md#enabling-and-disabling-operations)
348+
To completely disable some operations from your application, refer to the [disabling operations](../core/operations.md#enabling-and-disabling-operations)
349349
section.
350350

351351
## Changing Serialization Groups Depending of the Current User
352352

353-
See [how to dynamically change](serialization.md#changing-the-serialization-context-dynamically) the current Serializer context according to the current logged in user.
353+
See [how to dynamically change](../core/serialization.md#changing-the-serialization-context-dynamically) the current Serializer context according to the current logged-in user.

symfony/testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ If you would like to verify that your stack (including services such as the DBMS
377377
works, you need [end-to-end testing](https://wiki.c2.com/?EndToEndPrinciple). To do so, we recommend using [Playwright](https://playwright.dev) if you use have PWA/JavaScript-heavy app, or [Symfony Panther](https://github.com/symfony/panther) if you mostly use Twig.
378378

379379
Usually, end-to-end testing should be done with a production-like setup. For your convenience, you may [run our Docker Compose setup
380-
for production locally](../deployment/docker-compose.md#running-the-docker-compose-setup-for-production-locally).
380+
for production locally](../deployment/docker-compose.md#deploying-with-docker-compose).
381381

382382
## Testing Utilities for Symfony
383383

symfony/validation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ error will look like the following if the requested format is JSON-LD (the defau
104104
}
105105
```
106106

107-
Take a look at the [Errors Handling guide](errors.md) to learn how API Platform converts PHP exceptions like validation
107+
Take a look at the [Errors Handling guide](../core/errors.md) to learn how API Platform converts PHP exceptions like validation
108108
errors to HTTP errors.
109109

110110
## Using Validation Groups
@@ -136,7 +136,7 @@ class Book
136136

137137
With the previous configuration, the validation groups `a` and `b` will be used when validation is performed.
138138

139-
Like for [serialization groups](serialization.md#using-different-serialization-groups-per-operation),
139+
Like for [serialization groups](../core/serialization.md#using-serialization-groups-per-operation),
140140
you can specify validation groups globally or on a per-operation basis.
141141

142142
Of course, you can use XML or YAML configuration format instead of attributes if you prefer.
@@ -146,7 +146,7 @@ the array of group names.
146146

147147
## Using Validation Groups on Operations
148148

149-
You can have different validation for each [operation](operations.md) related to your resource.
149+
You can have different validation for each [operation](../core/operations.md) related to your resource.
150150

151151
```php
152152
<?php
@@ -456,7 +456,7 @@ In this example, only `severity` and `anotherPayloadField` will be serialized.
456456

457457
Use the [Valid](https://symfony.com/doc/current/reference/constraints/Valid.html) constraint.
458458

459-
Note: this is related to the [collection relation denormalization](./serialization.md#collection-relation).
459+
Note: this is related to the [collection relation denormalization](../core/serialization.md#collection-relation-using-doctrine).
460460
You may have an issue when trying to validate a relation representing a Doctrine's `ArrayCollection` (`toMany`). Fix the denormalization using the property getter. Return an `array` instead of an `ArrayCollection` with `$collectionRelation->getValues()`. Then, define your validation on the getter instead of the property.
461461

462462
For example:

0 commit comments

Comments
 (0)