From af2c6c584d899b4c3cb27e71c0a7c11680448257 Mon Sep 17 00:00:00 2001 From: Tim Krase <38947626+timkrase@users.noreply.github.com> Date: Fri, 16 Feb 2024 09:16:14 +0100 Subject: [PATCH 1/3] fix: add missing import in code example in validation.md (#1899) --- core/validation.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core/validation.md b/core/validation.md index 6c1c3d63334..597085b48ea 100644 --- a/core/validation.md +++ b/core/validation.md @@ -407,6 +407,7 @@ Create a processor, which receives the default processor, where you will trigger namespace App\State; use ApiPlatform\Doctrine\Common\State\RemoveProcessor as DoctrineRemoveProcessor; +use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProcessorInterface; use ApiPlatform\Validator\ValidatorInterface; use App\Entity\MyEntity; From e53ec30f7e4ab263622274d4694cc0051e0d7e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20H=C3=A9bert?= Date: Tue, 24 Sep 2024 14:11:43 +0200 Subject: [PATCH 2/3] fix (images): Use relative links for the symfonycast player --- core/content-negotiation.md | 2 +- core/extending-jsonld-context.md | 4 ++-- core/extending.md | 2 +- core/filters.md | 2 +- core/getting-started.md | 2 +- core/index.md | 2 +- core/jwt.md | 2 +- core/openapi.md | 2 +- core/operations.md | 2 +- core/pagination.md | 2 +- core/security.md | 2 +- core/serialization.md | 8 ++++---- core/testing.md | 2 +- core/validation.md | 2 +- deployment/index.md | 2 +- distribution/debugging.md | 2 +- distribution/index.md | 2 +- distribution/testing.md | 2 +- extra/contribution-guides.md | 2 +- 19 files changed, 23 insertions(+), 23 deletions(-) diff --git a/core/content-negotiation.md b/core/content-negotiation.md index 3442647713c..a23dc856353 100644 --- a/core/content-negotiation.md +++ b/core/content-negotiation.md @@ -9,7 +9,7 @@ Using the raw JSON or raw XML formats is discouraged, prefer using JSON-LD inste API Platform also supports [JSON Merge Patch (RFC 7396)](https://tools.ietf.org/html/rfc7396) the JSON:API [`PATCH`](https://tools.ietf.org/html/rfc5789) formats, as well as [Problem Details (RFC 7807)](https://tools.ietf.org/html/rfc7807), Hydra and JSON:API error formats. -

Formats screencast
Watch the Formats screencast

+

Formats screencast
Watch the Formats screencast

API Platform will automatically detect the best resolving format depending on: diff --git a/core/extending-jsonld-context.md b/core/extending-jsonld-context.md index acf49db5539..298085d073b 100644 --- a/core/extending-jsonld-context.md +++ b/core/extending-jsonld-context.md @@ -2,7 +2,7 @@ ## JSON-LD -

JSON-LD screencast
Watch the JSON-LD screencast

+

JSON-LD screencast
Watch the JSON-LD screencast

API Platform provides the possibility to extend the JSON-LD context of properties. This allows you to describe JSON-LD-typed values, inverse properties using the `@reverse` keyword and you can even overwrite the `@id` property this way. Everything you define @@ -63,7 +63,7 @@ Note that you do not have to provide the `@id` attribute. If you do not provide ## Hydra -

Hydra screencast
Watch the Hydra screencast

+

Hydra screencast
Watch the Hydra screencast

It's also possible to replace the Hydra context used by the documentation generator: diff --git a/core/extending.md b/core/extending.md index 2d161ab787e..c6294970c1b 100644 --- a/core/extending.md +++ b/core/extending.md @@ -35,4 +35,4 @@ For instance, if you want to send a mail after a resource has been persisted, bu To replace existing API Platform services with your decorators, [check out how to decorate services](https://symfony.com/doc/current/service_container/service_decoration.html). -

Service Decoration screencast
Watch the Service Decoration screencast

+

Service Decoration screencast
Watch the Service Decoration screencast

diff --git a/core/filters.md b/core/filters.md index 01b2721d16f..a135195c213 100644 --- a/core/filters.md +++ b/core/filters.md @@ -12,7 +12,7 @@ By default, all filters are disabled. They must be enabled explicitly. When a filter is enabled, it automatically appears in the [OpenAPI](swagger.md) and [GraphQL](graphql.md) documentations. It is also automatically documented as a `hydra:search` property for JSON-LD responses. -

Filtering and Searching screencast
Watch the Filtering & Searching screencast

+

Filtering and Searching screencast
Watch the Filtering & Searching screencast

## Doctrine ORM and MongoDB ODM Filters diff --git a/core/getting-started.md b/core/getting-started.md index 1a98abfce9a..a6837dde058 100644 --- a/core/getting-started.md +++ b/core/getting-started.md @@ -30,7 +30,7 @@ and what [JSON-LD](http://json-ld.org/) and [Hydra](http://www.hydra-cg.com/) fo ## Mapping the Entities -

Create an API Resource screencast
Watch the Create an API Resource screencast

+

Create an API Resource screencast
Watch the Create an API Resource screencast

API Platform is able to automatically expose entities mapped as "API resources" through a REST API supporting CRUD operations. diff --git a/core/index.md b/core/index.md index 58b2cd85fef..089999ec2cd 100644 --- a/core/index.md +++ b/core/index.md @@ -43,6 +43,6 @@ This bundle is extensively tested (unit and functional). The [`Fixtures/` direct ## Screencasts -

SymfonyCasts, API Platform screencasts

+

SymfonyCasts, API Platform screencasts

The easiest and funniest way to learn how to use API Platform is to watch [the more than 60 screencasts available on SymfonyCasts](https://symfonycasts.com/tracks/rest?cid=apip#api-platform)! diff --git a/core/jwt.md b/core/jwt.md index 3594b9382ee..96ed44ba53a 100644 --- a/core/jwt.md +++ b/core/jwt.md @@ -7,7 +7,7 @@ The tokens are signed by the server's key, so the server is able to verify that API Platform allows to easily add a JWT-based authentication to your API using [LexikJWTAuthenticationBundle](https://github.com/lexik/LexikJWTAuthenticationBundle). -

JWT screencast
Watch the LexikJWTAuthenticationBundle screencast

+

JWT screencast
Watch the LexikJWTAuthenticationBundle screencast

## Installing LexikJWTAuthenticationBundle diff --git a/core/openapi.md b/core/openapi.md index 32931cdb9a3..489466d3fe6 100644 --- a/core/openapi.md +++ b/core/openapi.md @@ -4,7 +4,7 @@ API Platform natively support the [OpenAPI](https://www.openapis.org/) API speci ![Screenshot](../distribution/images/swagger-ui-1.png) -

OpenAPI screencast
Watch the OpenAPI screencast

+

OpenAPI screencast
Watch the OpenAPI screencast

The specification of the API is available at the `/docs.json` path. By default, OpenAPI v3 is used. diff --git a/core/operations.md b/core/operations.md index 4f21c0d18c2..b5acc955401 100644 --- a/core/operations.md +++ b/core/operations.md @@ -3,7 +3,7 @@ API Platform relies on the concept of operations. Operations can be applied to a resource exposed by the API. From an implementation point of view, an operation is a link between a resource, a route and its related controller. -

Operations screencast
Watch the Operations screencast

+

Operations screencast
Watch the Operations screencast

API Platform automatically registers typical [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) operations and describes them in the exposed documentation (Hydra and Swagger). It also creates and registers routes corresponding diff --git a/core/pagination.md b/core/pagination.md index 589b4e13335..46a7c22233f 100644 --- a/core/pagination.md +++ b/core/pagination.md @@ -1,6 +1,6 @@ # Pagination -

Pagination screencast
Watch the Pagination screencast

+

Pagination screencast
Watch the Pagination screencast

API Platform has native support for paged collections. Pagination is enabled by default for all collections. Each collection contains 30 items per page. diff --git a/core/security.md b/core/security.md index d84c323fe67..416a6e12f0c 100644 --- a/core/security.md +++ b/core/security.md @@ -4,7 +4,7 @@ The API Platform security layer is built on top of the [Symfony Security compone All its features, including [global access control directives](http://symfony.com/doc/current/book/security.html#securing-url-patterns-access-control) are supported. API Platform also provides convenient [access control expressions](https://symfony.com/doc/current/expressions.html#security-complex-access-controls-with-expressions) which you can apply at resource and operation level. -

Security screencast
Watch the Security screencast

+

Security screencast
Watch the Security screencast

diff --git a/core/serialization.md b/core/serialization.md index 0596cad49cd..3d5897617b4 100644 --- a/core/serialization.md +++ b/core/serialization.md @@ -4,7 +4,7 @@ API Platform embraces and extends the Symfony Serializer Component to transform PHP entities in (hypermedia) API responses. -

Serializer screencast
Watch the Serializer screencast

+

Serializer screencast
Watch the Serializer screencast

The main serialization process has two stages: @@ -32,7 +32,7 @@ JSON-LD, or JavaScript Object Notation for Linked Data, is a method of encoding ## The Serialization Context, Groups and Relations -

Serialization Groups screencast
Watch the Serialization Groups screencast

+

Serialization Groups screencast
Watch the Serialization Groups screencast

API Platform allows you to specify the `$context` variable used by the Symfony Serializer. This variable is an associative array that has a handy `groups` key allowing you to choose which attributes of the resource are exposed during the normalization (read) and denormalization (write) processes. It relies on the [serialization (and deserialization) groups](https://symfony.com/doc/current/components/serializer.html#attributes-groups) @@ -300,7 +300,7 @@ Refer to the [operations](operations.md) documentation to learn more. ## Embedding Relations -

Relations screencast
Watch the Relations screencast

+

Relations screencast
Watch the Relations screencast

By default, the serializer provided with API Platform represents relations between objects using [dereferenceable IRIs](https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier). They allow you to retrieve details for related objects by issuing extra HTTP requests. However, for performance reasons, it is sometimes preferable to avoid forcing the client to issue extra HTTP requests. @@ -770,7 +770,7 @@ App\Entity\Greeting: ## Changing the Serialization Context Dynamically -

Context Builder & Service Decoration screencast
Watch the Context Builder & Service Decoration screencast

+

Context Builder & Service Decoration screencast
Watch the Context Builder & Service Decoration screencast

Let's imagine a resource where most fields can be managed by any user, but some can be managed only by admin users: diff --git a/core/testing.md b/core/testing.md index fb268948da5..53cfad4775e 100644 --- a/core/testing.md +++ b/core/testing.md @@ -3,7 +3,7 @@ API Platform provides a set of useful utilities dedicated to API testing. For an overview of how to test an API Platform app, be sure to read [the testing cookbook first](../distribution/testing.md). -

Test and Assertions screencast
Watch the API Tests & Assertions screencast

+

Test and Assertions screencast
Watch the API Tests & Assertions screencast

## The Test HttpClient diff --git a/core/validation.md b/core/validation.md index 597085b48ea..9a3a46c9f69 100644 --- a/core/validation.md +++ b/core/validation.md @@ -4,7 +4,7 @@ API Platform takes care of validating the data sent to the API by the client (us By default, the framework relies on [the powerful Symfony Validator Component](http://symfony.com/doc/current/validation.html) for this task, but you can replace it with your preferred validation library such as [the PHP filter extension](https://www.php.net/manual/en/intro.filter.php) if you want to. -

Validation screencast
Watch the Validation screencast

+

Validation screencast
Watch the Validation screencast

## Validating Submitted Data diff --git a/deployment/index.md b/deployment/index.md index b8dc3b07f48..cac63909614 100644 --- a/deployment/index.md +++ b/deployment/index.md @@ -9,7 +9,7 @@ If you want to play with a local Kubernetes cluster, read [how to deploy an API If you don't want to use Docker, keep in mind that the server application of API Platform is a standard Symfony project, while the Progressive Web Application is a standard Next.js project: -

JWT screencast
Watch the Animated Deployment with Ansistrano screencast

+

JWT screencast
Watch the Animated Deployment with Ansistrano screencast

* [Deploying the Symfony application](https://symfony.com/doc/current/deployment.html) * [Deploying the Next.js application](https://nextjs.org/docs/deployment) diff --git a/distribution/debugging.md b/distribution/debugging.md index aa53982be52..c64905f3065 100644 --- a/distribution/debugging.md +++ b/distribution/debugging.md @@ -1,6 +1,6 @@ # Debugging -

API Platform debugging screencast
Watch the Debugging API Platform screencast

+

API Platform debugging screencast
Watch the Debugging API Platform screencast

## Xdebug diff --git a/distribution/index.md b/distribution/index.md index 0fffe8ce14d..39c90111ad1 100644 --- a/distribution/index.md +++ b/distribution/index.md @@ -794,6 +794,6 @@ and [browse it online](https://demo.api-platform.com). ## Screencasts -

SymfonyCasts, API Platform screencasts

+

SymfonyCasts, API Platform screencasts

The easiest and funniest way to learn how to use API Platform is to watch [the more than 60 screencasts available on SymfonyCasts](https://symfonycasts.com/tracks/rest?cid=apip#api-platform)! diff --git a/distribution/testing.md b/distribution/testing.md index e076e149d12..b6b89be362f 100644 --- a/distribution/testing.md +++ b/distribution/testing.md @@ -7,7 +7,7 @@ API Platform provides a set of helpful testing utilities to write unit tests, fu Let's learn how to use them! -

Tests and Assertions screencast
Watch the Tests & Assertions screencast

+

Tests and Assertions screencast
Watch the Tests & Assertions screencast

In this article you'll learn how to use: diff --git a/extra/contribution-guides.md b/extra/contribution-guides.md index 17dd84cd79f..ac658d5c8a1 100644 --- a/extra/contribution-guides.md +++ b/extra/contribution-guides.md @@ -7,4 +7,4 @@ **To report a security issue, please refer to [the dedicated document](security.md).** -

JWT screencast
Watch the Contributing back to Symfony screencast (free)

+

JWT screencast
Watch the Contributing back to Symfony screencast (free)

From 5623d71ac736830a98d4b9cd760d2a22ddf1cf63 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 25 Feb 2025 16:02:51 +0100 Subject: [PATCH 3/3] fix: code preview (#2139) --- core/subresources.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core/subresources.md b/core/subresources.md index 0570ff681f7..de9c1247226 100644 --- a/core/subresources.md +++ b/core/subresources.md @@ -102,6 +102,7 @@ To make things work, API Platform needs information about how to retrieve the `A the `Question`, this is done by configuring the `uriVariables`: + ```php