Skip to content

Commit bd8daf6

Browse files
committed
Merge 2.7 into 3.0
2 parents fd598fc + e98885e commit bd8daf6

File tree

8 files changed

+85
-56
lines changed

8 files changed

+85
-56
lines changed

core/extending-jsonld-context.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## JSON-LD
44

5-
<p align="center" class="symfonycasts"><a href="https://symfonycasts.com/screencast/api-platform/json-ld?cid=apip"><img src="../distribution/images/symfonycasts-player.png" alt="JSON-LD screencast"><br>Watch the JSON-LD screencast</a>
5+
<p align="center" class="symfonycasts"><a href="https://symfonycasts.com/screencast/api-platform/json-ld?cid=apip"><img src="../distribution/images/symfonycasts-player.png" alt="JSON-LD screencast"><br>Watch the JSON-LD screencast</a></p>
66

77
API Platform provides the possibility to extend the JSON-LD context of properties. This allows you to describe JSON-LD-typed
88
values, inverse properties using the `@reverse` keyword and you can even overwrite the `@id` property this way. Everything you define

core/filters.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ By default, all filters are disabled. They must be enabled explicitly.
1212
When a filter is enabled, it automatically appears in the [OpenAPI](swagger.md) and [GraphQL](graphql.md) documentations.
1313
It is also automatically documented as a `hydra:search` property for JSON-LD responses.
1414

15-
<p align="center" class="symfonycasts"><a href="https://symfonycasts.com/screencast/api-platform/filters?cid=apip"><img src="../distribution/images/symfonycasts-player.png" alt="Filtering and Searching screencast"><br>Watch the Filtering & Searching screencast</a>
15+
<p align="center" class="symfonycasts"><a href="https://symfonycasts.com/screencast/api-platform/filters?cid=apip"><img src="../distribution/images/symfonycasts-player.png" alt="Filtering and Searching screencast"><br>Watch the Filtering & Searching screencast</a></p>
1616

1717
## Doctrine ORM and MongoDB ODM Filters
1818

@@ -548,7 +548,7 @@ namespace App\Entity;
548548
549549
use ApiPlatform\Metadata\ApiFilter;
550550
use ApiPlatform\Metadata\ApiResource;
551-
use ApiPlatform\Doctrine\Orm\Filter\ExistsFilter;
551+
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\ExistsFilter;
552552
553553
#[ApiResource]
554554
#[ApiFilter(ExistsFilter::class, properties: ['transportFees'])]

core/identifiers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ resource:
4646
```
4747
4848
```xml
49-
<properties xmlns="https://api-platform.com/schema/metadata/properties">
49+
<properties xmlns="https://api-platform.com/schema/metadata/properties%3Cspan%20class="x x-first x-last">-3.0">
5050
<property resource="App\Entity\Person" name="code" identifier="true"/>
5151
</properties>
5252
<resources xmlns="https://api-platform.com/schema/metadata/resources-3.0">

core/security.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The API Platform security layer is built on top of the [Symfony Security compone
44
All its features, including [global access control directives](http://symfony.com/doc/current/book/security.html#securing-url-patterns-access-control) are supported.
55
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.
66

7-
<p align="center" class="symfonycasts"><a href="https://symfonycasts.com/screencast/api-platform-security/?cid=apip"><img src="../distribution/images/symfonycasts-player.png" alt="Security screencast"><br>Watch the Security screencast</a>
7+
<p align="center" class="symfonycasts"><a href="https://symfonycasts.com/screencast/api-platform-security/?cid=apip"><img src="../distribution/images/symfonycasts-player.png" alt="Security screencast"><br>Watch the Security screencast</a></p>
88

99
[codeSelector]
1010

core/serialization.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,8 @@ Note: this normalizer will work only for JSON-LD format, if you want to process
10111011

10121012
```php
10131013
<?php
1014-
// api/src/Serializer/ApiNormalizer
1014+
// api/src/Serializer/ApiNormalizer.php
1015+
10151016
namespace App\Serializer;
10161017
10171018
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;

create-client/custom.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Custom Generator
22

3-
Create Client provides support for many of the popular JS frameworks, but you may be using another framework or language and may need a solution adapted to your specific needs. For this cenario, you can write your own generator and pass it to the CLI using a path as the `-g` argument.
3+
Create Client provides support for many of the popular JS frameworks, but you may be using another framework or language and may need a solution adapted to your specific needs. For this scenario, you can write your own generator and pass it to the CLI using a path as the `-g` argument.
44

55
You will probably want to extend or, at least, take a look at [BaseGenerator.js](https://github.com/api-platform/create-client/blob/main/src/generators/BaseGenerator.js), since the library expects some methods to be available, as well as one of the [included generators](https://github.com/api-platform/create-client/blob/main/src/generators/BaseGenerator.js) to make your own.
66

deployment/kubernetes.md

+76-48
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,37 @@ Change the name "test-api-platform" to your Google project ID (not the project n
2929
[Quickstart Google Cloud](https://cloud.google.com/sdk/docs/quickstart?hl=de)
3030
If you do not have gcloud yet, install it with these command.
3131

32-
curl https://sdk.cloud.google.com | bash
32+
```
33+
curl https://sdk.cloud.google.com | bash
34+
```
3335

3436
#### 1. Build the PHP and Caddy Docker images and tag them
3537

3638
Versioning: The 0.1.0 is the version. This value should be the same as the attribute `appVersion` in `Chart.yaml`.
3739
Infos for [Google Container pulling and pushing](https://cloud.google.com/container-registry/docs/pushing-and-pulling)
3840

39-
docker build -t gcr.io/test-api-platform/php:0.1.0 -t gcr.io/test-api-platform/php:latest api --target api_platform_php
40-
docker build -t gcr.io/test-api-platform/caddy:0.1.0 -t gcr.io/test-api-platform/caddy:latest api --target api_platform_caddy
41-
docker build -t gcr.io/test-api-platform/pwa:0.1.0 -t gcr.io/test-api-platform/pwa:latest pwa --target api_platform_pwa_prod
41+
```
42+
docker build -t gcr.io/test-api-platform/php:0.1.0 -t gcr.io/test-api-platform/php:latest api --target api_platform_php
43+
docker build -t gcr.io/test-api-platform/caddy:0.1.0 -t gcr.io/test-api-platform/caddy:latest api --target api_platform_caddy
44+
docker build -t gcr.io/test-api-platform/pwa:0.1.0 -t gcr.io/test-api-platform/pwa:latest pwa --target api_platform_pwa_prod
45+
```
4246

4347
#### 2. Push your images to your Docker registry
4448

45-
gcloud auth configure-docker
46-
docker push gcr.io/test-api-platform/php
47-
docker push gcr.io/test-api-platform/caddy
48-
docker push gcr.io/test-api-platform/pwa
49+
```
50+
gcloud auth configure-docker
51+
docker push gcr.io/test-api-platform/php
52+
docker push gcr.io/test-api-platform/caddy
53+
docker push gcr.io/test-api-platform/pwa
54+
```
4955

5056
Optional push the version images:
5157

52-
docker push gcr.io/test-api-platform/php:0.1.0
53-
docker push gcr.io/test-api-platform/caddy:0.1.0
54-
docker push gcr.io/test-api-platform/pwa:0.1.0
58+
```
59+
docker push gcr.io/test-api-platform/php:0.1.0
60+
docker push gcr.io/test-api-platform/caddy:0.1.0
61+
docker push gcr.io/test-api-platform/pwa:0.1.0
62+
```
5563

5664
The result should look similar to these images.
5765

@@ -62,35 +70,43 @@ The result should look similar to these images.
6270

6371
### 1. Check the Helm version
6472

65-
helm version
73+
```
74+
helm version
75+
```
6676

6777
If you are using version 2.x follow this [guide to migrate Helm to v3](https://helm.sh/docs/topics/v2_v3_migration/#helm)
6878

6979
### 2. Firstly you need to update helm dependencies by running
7080

71-
helm dependency update ./helm/api-platform
81+
```
82+
helm dependency update ./helm/api-platform
83+
```
7284

7385
This will create a folder helm/api-platform/charts/ and add all dependencies there.
7486
Actual this is [bitnami/postgresql](https://bitnami.com/stack/postgresql/helm), a file postgresql-[VERSION].tgz is created.
7587

7688
### 3. Optional: If you made changes to the Helm chart, check if its format is correct
7789

78-
helm lint ./helm/api-platform
90+
```
91+
helm lint ./helm/api-platform
92+
```
7993

8094
### 4. Deploy your API to the container
8195

82-
helm upgrade main ./helm/api-platform --namespace=default --create-namespace --wait \
83-
--install \
84-
--set "php.image.repository=gcr.io/test-api-platform/php" \
85-
--set php.image.tag=latest \
86-
--set "caddy.image.repository=gcr.io/test-api-platform/caddy" \
87-
--set caddy.image.tag=latest \
88-
--set "pwa.image.repository=gcr.io/test-api-platform/pwa" \
89-
--set pwa.image.tag=latest \
90-
--set php.appSecret='!ChangeMe!' \
91-
--set postgresql.postgresqlPassword='!ChangeMe!' \
92-
--set postgresql.persistence.enabled=true \
93-
--set "corsAllowOrigin=^https?:\/\/[a-z]*\.mywebsite.com$"
96+
```
97+
helm upgrade main ./helm/api-platform --namespace=default --create-namespace --wait \
98+
--install \
99+
--set "php.image.repository=gcr.io/test-api-platform/php" \
100+
--set php.image.tag=latest \
101+
--set "caddy.image.repository=gcr.io/test-api-platform/caddy" \
102+
--set caddy.image.tag=latest \
103+
--set "pwa.image.repository=gcr.io/test-api-platform/pwa" \
104+
--set pwa.image.tag=latest \
105+
--set php.appSecret='!ChangeMe!' \
106+
--set postgresql.postgresqlPassword='!ChangeMe!' \
107+
--set postgresql.persistence.enabled=true \
108+
--set "corsAllowOrigin=^https?:\/\/[a-z]*\.mywebsite.com$"
109+
```
94110

95111
The `"` are necessary for Windows. Use ^ on Windows instead of \ to split commands into multiple lines.
96112
You can add the parameter `--dry-run` to check upfront if anything is correct.
@@ -109,10 +125,12 @@ get access on your local machine to the deploy. See image below.
109125
If you prefer to use a managed DBMS like [Heroku Postgres](https://www.heroku.com/postgres) or
110126
[Google Cloud SQL](https://cloud.google.com/sql/docs/postgres/) (recommended):
111127

112-
helm upgrade api-platform ./helm/api-platform \
113-
# ...
114-
--set postgresql.enabled=false \
115-
--set postgresql.url=pgsql://username:password@host/database?serverVersion=13
128+
```
129+
helm upgrade api-platform ./helm/api-platform \
130+
# ...
131+
--set postgresql.enabled=false \
132+
--set postgresql.url=pgsql://username:password@host/database?serverVersion=13
133+
```
116134

117135
Finally, build the `pwa` (client and admin) JavaScript apps and [deploy them on a static
118136
site hosting service](https://create-react-app.dev/docs/deployment/).
@@ -122,8 +140,10 @@ site hosting service](https://create-react-app.dev/docs/deployment/).
122140
You can access the php container of the pod with the following command.
123141
In this example the symfony console is called.
124142

125-
CADDY_PHP_POD=$(kubectl --namespace=default get pods -l app.kubernetes.io/name=api-platform -o jsonpath="{.items[0].metadata.name}")
126-
kubectl --namespace=default exec -it $CADDY_PHP_POD -c api-platform-php -- bin/console
143+
```
144+
CADDY_PHP_POD=$(kubectl --namespace=default get pods -l app.kubernetes.io/name=api-platform -o jsonpath="{.items[0].metadata.name}")
145+
kubectl --namespace=default exec -it $CADDY_PHP_POD -c api-platform-php -- bin/console
146+
```
127147

128148
## Caution for system architecture
129149

@@ -148,7 +168,8 @@ You can upgrade with the same command from the installation and pass all paramet
148168
Infos about [best practices for tagging images for kubernetes](https://kubernetes.io/docs/concepts/containers/images/)
149169
You have to use the *.image.pullPolicy=Always see the last 3 parameters.
150170

151-
helm upgrade api-platform ./helm/api-platform --namespace=default \
171+
```
172+
helm upgrade api-platform ./helm/api-platform --namespace=default \
152173
--set "php.image.repository=gcr.io/test-api-platform/php" \
153174
--set php.image.tag=latest \
154175
--set "caddy.image.repository=gcr.io/test-api-platform/caddy" \
@@ -162,6 +183,7 @@ You have to use the *.image.pullPolicy=Always see the last 3 parameters.
162183
--set php.image.pullPolicy=Always \
163184
--set caddy.image.pullPolicy=Always \
164185
--set pwa.image.pullPolicy=Always
186+
```
165187

166188
## GitHub Actions Example for deployment
167189

@@ -175,24 +197,30 @@ Start by creating a new template for the queue-worker-deployment. The `deploymen
175197

176198
Add the following lines under `containers` to overwrite the command.
177199

178-
command:
179-
{{ range .Values.queue_worker.command }}
180-
- {{ . | quote }}
181-
{{ end }}
182-
args:
183-
{{ range .Values.queue_worker.commandArgs }}
184-
- {{ . | quote }}
185-
{{ end }}
200+
```
201+
command:
202+
{{ range .Values.queue_worker.command }}
203+
- {{ . | quote }}
204+
{{ end }}
205+
args:
206+
{{ range .Values.queue_worker.commandArgs }}
207+
- {{ . | quote }}
208+
{{ end }}
209+
```
186210

187211
Here is an example on how to use it from your `values.yaml`:
188212

189-
command: ['bin/console']
190-
commandArgs: ['messenger:consume', 'async', '--memory-limit=100M']
213+
```
214+
command: ['bin/console']
215+
commandArgs: ['messenger:consume', 'async', '--memory-limit=100M']
216+
```
191217

192218
The `readinessProbe` and the `livenessProble` can not use the default `docker-healthcheck` but should test if the command is running.
193219

194-
readinessProbe:
195-
exec:
196-
command: ["/bin/sh", "-c", "/bin/ps -ef | grep messenger:consume | grep -v grep"]
197-
initialDelaySeconds: 120
198-
periodSeconds: 3
220+
```
221+
readinessProbe:
222+
exec:
223+
command: ["/bin/sh", "-c", "/bin/ps -ef | grep messenger:consume | grep -v grep"]
224+
initialDelaySeconds: 120
225+
periodSeconds: 3
226+
```

extra/contribution-guides.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77

88
**To report a security issue, please refer to [the dedicated document](security.md).**
99

10-
<p align="center" class="symfonycasts"><a href="https://symfonycasts.com/screencast/contributing?cid=apip"><img src="../distribution/images/symfonycasts-player.png" alt="JWT screencast"><br>Watch the Contributing back to Symfony screencast (free-</a></p>
10+
<p align="center" class="symfonycasts"><a href="https://symfonycasts.com/screencast/contributing?cid=apip"><img src="../distribution/images/symfonycasts-player.png" alt="JWT screencast"><br>Watch the Contributing back to Symfony screencast (free)</a></p>

0 commit comments

Comments
 (0)