Skip to content

Commit 0f253cb

Browse files
chore: upgrade API Platform to 4.3.0 (#604)
1 parent 277b504 commit 0f253cb

7 files changed

Lines changed: 291 additions & 171 deletions

File tree

api/composer.lock

Lines changed: 237 additions & 156 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/config/packages/api_platform.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
api_platform:
22
title: API Platform's demo
3-
version: 4.2.21
3+
version: 4.3.0
44
description: |
55
This is a demo application of the [API Platform](https://api-platform.com) framework.
66
[Its source code](https://github.com/api-platform/demo) includes various examples, check it out!

api/config/reference.php

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -993,8 +993,8 @@
993993
* }
994994
* @psalm-type MercureConfig = array{
995995
* hubs?: array<string, array{ // Default: []
996-
* url?: scalar|Param|null, // URL of the hub's publish endpoint
997-
* public_url?: scalar|Param|null, // URL of the hub's public endpoint // Default: null
996+
* url?: scalar|Param|null, // URL of the hub's publish endpoint // Default: null
997+
* public_url?: scalar|Param|null, // URL of the hub's public endpoint
998998
* jwt?: string|array{ // JSON Web Token configuration.
999999
* value?: scalar|Param|null, // JSON Web Token to use to publish to this hub.
10001000
* provider?: scalar|Param|null, // The ID of a service to call to provide the JSON Web Token.
@@ -1242,6 +1242,9 @@
12421242
* serialize_payload_fields?: mixed, // Set to null to serialize all payload fields when a validation error is thrown, or set the fields you want to include explicitly. // Default: []
12431243
* query_parameter_validation?: bool|Param, // Deprecated: Will be removed in API Platform 5.0. // Default: true
12441244
* },
1245+
* jsonapi?: array{
1246+
* use_iri_as_id?: bool|Param, // Set to false to use entity identifiers instead of IRIs as the "id" field in JSON:API responses. // Default: true
1247+
* },
12451248
* eager_loading?: bool|array{
12461249
* enabled?: bool|Param, // Default: true
12471250
* fetch_partial?: bool|Param, // Fetch only partial data according to serialization groups. If enabled, Doctrine ORM entities will not work as expected if any of the other fields are used. // Default: false
@@ -1253,11 +1256,12 @@
12531256
* enable_json_streamer?: bool|Param, // Enable json streamer. // Default: true
12541257
* enable_swagger_ui?: bool|Param, // Enable Swagger UI // Default: true
12551258
* enable_re_doc?: bool|Param, // Enable ReDoc // Default: true
1259+
* enable_scalar?: bool|Param, // Enable Scalar API Reference // Default: true
12561260
* enable_entrypoint?: bool|Param, // Enable the entrypoint // Default: true
12571261
* enable_docs?: bool|Param, // Enable the docs // Default: true
12581262
* enable_profiler?: bool|Param, // Enable the data collector and the WebProfilerBundle integration. // Default: true
12591263
* enable_phpdoc_parser?: bool|Param, // Enable resource metadata collector using PHPStan PhpDocParser. // Default: true
1260-
* enable_link_security?: bool|Param, // Enable security for Links (sub resources) // Default: false
1264+
* enable_link_security?: bool|Param, // Deprecated: This option is always enabled and will be removed in API Platform 5.0. // Enable security for Links (sub resources). // Default: true
12611265
* collection?: array{
12621266
* exists_parameter_name?: scalar|Param|null, // The name of the query parameter to filter on nullable field values. // Default: "exists"
12631267
* order?: scalar|Param|null, // The default order of results. // Default: "ASC"
@@ -1357,6 +1361,9 @@
13571361
* elasticsearch?: bool|array{
13581362
* enabled?: bool|Param, // Default: false
13591363
* hosts?: list<scalar|Param|null>,
1364+
* ssl_ca_bundle?: scalar|Param|null, // Path to the SSL CA bundle file for Elasticsearch SSL verification. // Default: null
1365+
* ssl_verification?: bool|Param, // Enable or disable SSL verification for Elasticsearch connections. // Default: true
1366+
* client?: "elasticsearch"|"opensearch"|Param, // The search engine client to use: "elasticsearch" or "opensearch". // Default: "elasticsearch"
13601367
* },
13611368
* openapi?: array{
13621369
* contact?: array{
@@ -1375,12 +1382,18 @@
13751382
* identifier?: scalar|Param|null, // An SPDX license expression for the API. The identifier field is mutually exclusive of the url field. // Default: null
13761383
* },
13771384
* swagger_ui_extra_configuration?: mixed, // To pass extra configuration to Swagger UI, like docExpansion or filter. // Default: []
1385+
* scalar_extra_configuration?: mixed, // To pass extra configuration to Scalar API Reference, like theme or darkMode. // Default: []
13781386
* overrideResponses?: bool|Param, // Whether API Platform adds automatic responses to the OpenAPI documentation. // Default: true
13791387
* error_resource_class?: scalar|Param|null, // The class used to represent errors in the OpenAPI documentation. // Default: null
13801388
* validation_error_resource_class?: scalar|Param|null, // The class used to represent validation errors in the OpenAPI documentation. // Default: null
13811389
* },
13821390
* maker?: bool|array{
13831391
* enabled?: bool|Param, // Default: true
1392+
* namespace_prefix?: scalar|Param|null, // Add a prefix to all maker generated classes. e.g set it to "Api" to set the maker namespace to "App\Api\" (if the maker.root_namespace config is App). e.g. App\Api\State\MyStateProcessor // Default: ""
1393+
* },
1394+
* mcp?: bool|array{
1395+
* enabled?: bool|Param, // Default: true
1396+
* format?: scalar|Param|null, // The serialization format used for MCP tool input/output. Must be a format registered in api_platform.formats (e.g. "jsonld", "json", "jsonapi"). // Default: "jsonld"
13841397
* },
13851398
* exception_to_status?: array<string, int|Param>,
13861399
* formats?: array<string, array{ // Default: {"jsonld":{"mime_types":["application/ld+json"]}}
@@ -1465,19 +1478,45 @@
14651478
* rules?: mixed,
14661479
* policy?: mixed,
14671480
* middleware?: mixed,
1468-
* parameters?: mixed,
1481+
* parameters?: array<string, array{ // Default: []
1482+
* key?: mixed,
1483+
* schema?: mixed,
1484+
* open_api?: mixed,
1485+
* provider?: mixed,
1486+
* filter?: mixed,
1487+
* property?: mixed,
1488+
* description?: mixed,
1489+
* properties?: mixed,
1490+
* required?: mixed,
1491+
* priority?: mixed,
1492+
* hydra?: mixed,
1493+
* constraints?: mixed,
1494+
* security?: mixed,
1495+
* security_message?: mixed,
1496+
* extra_properties?: mixed,
1497+
* filter_context?: mixed,
1498+
* native_type?: mixed,
1499+
* cast_to_array?: mixed,
1500+
* cast_to_native_type?: mixed,
1501+
* cast_fn?: mixed,
1502+
* default?: mixed,
1503+
* filter_class?: mixed,
1504+
* ...<mixed>
1505+
* }>,
14691506
* strict_query_parameter_validation?: mixed,
14701507
* hide_hydra_operation?: mixed,
14711508
* json_stream?: mixed,
14721509
* extra_properties?: mixed,
14731510
* map?: mixed,
1511+
* mcp?: mixed,
14741512
* route_name?: mixed,
14751513
* errors?: mixed,
14761514
* read?: mixed,
14771515
* deserialize?: mixed,
14781516
* validate?: mixed,
14791517
* write?: mixed,
14801518
* serialize?: mixed,
1519+
* content_negotiation?: mixed,
14811520
* priority?: mixed,
14821521
* name?: mixed,
14831522
* allow_create?: mixed,

api/tests/Api/Admin/BookTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ public function asAdminUserICanCreateABook(): void
397397
$id = preg_replace('/^.*\/(.+)$/', '$1', (string) $response->toArray()['@id']);
398398
/** @var Book $book */
399399
$book = self::getContainer()->get(BookRepository::class)->find($id);
400-
self::assertCount(1, self::getMercureMessages());
400+
self::assertCount(2, self::getMercureMessages());
401401
self::assertEquals(
402402
new Update(
403403
topics: ['http://localhost/admin/books/' . $book->getId(), 'http://localhost/books/' . $book->getId()],
@@ -530,7 +530,7 @@ public function asAdminUserICanUpdateABook(): void
530530
'author' => 'Asimov, Isaac',
531531
]);
532532
self::assertMatchesJsonSchema(file_get_contents(__DIR__ . '/schemas/Book/item.json'));
533-
self::assertCount(1, self::getMercureMessages());
533+
self::assertCount(2, self::getMercureMessages());
534534
self::assertEquals(
535535
new Update(
536536
topics: ['http://localhost/admin/books/' . $book->getId(), 'http://localhost/books/' . $book->getId()],
@@ -601,7 +601,7 @@ public function asAdminUserICanDeleteABook(): void
601601
self::assertResponseStatusCodeSame(Response::HTTP_NO_CONTENT);
602602
self::assertEmpty($response->getContent());
603603
BookFactory::assert()->notExists(['title' => 'Hyperion']);
604-
self::assertCount(1, self::getMercureMessages());
604+
self::assertCount(2, self::getMercureMessages());
605605
self::assertEquals(
606606
new Update(
607607
topics: ['http://localhost/admin/books/' . $id, 'http://localhost/books/' . $id],

api/tests/Api/Admin/ReviewTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ public function asAdminUserICanUpdateAReview(): void
295295
// ensure user hasn't changed
296296
self::assertNotEquals($user, $review->user);
297297
self::assertMatchesJsonSchema(file_get_contents(__DIR__ . '/schemas/Review/item.json'));
298-
self::assertCount(1, self::getMercureMessages());
298+
self::assertCount(2, self::getMercureMessages());
299299
self::assertEquals(
300300
new Update(
301301
topics: [
@@ -372,7 +372,7 @@ public function asAdminUserICanDeleteAReview(): void
372372
self::assertResponseStatusCodeSame(Response::HTTP_NO_CONTENT);
373373
self::assertEmpty($response->getContent());
374374
ReviewFactory::assert()->notExists(['body' => 'Best book ever!']);
375-
self::assertCount(1, self::getMercureMessages());
375+
self::assertCount(2, self::getMercureMessages());
376376
self::assertEquals(
377377
new Update(
378378
topics: [

api/tests/Api/ReviewTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public function asAUserICanAddAReviewOnABook(): void
282282
$id = preg_replace('/^.*\/(.+)$/', '$1', (string) $response->toArray()['@id']);
283283
/** @var Review $review */
284284
$review = self::getContainer()->get(ReviewRepository::class)->find($id);
285-
self::assertCount(1, self::getMercureMessages());
285+
self::assertCount(2, self::getMercureMessages());
286286
self::assertMercureUpdateMatchesJsonSchema(
287287
update: self::getMercureMessage(),
288288
topics: [
@@ -474,7 +474,7 @@ public function asAUserICanUpdateMyBookReview(): void
474474
'rating' => 5,
475475
]);
476476
self::assertMatchesJsonSchema(file_get_contents(__DIR__ . '/schemas/Review/item.json'));
477-
self::assertCount(1, self::getMercureMessages());
477+
self::assertCount(2, self::getMercureMessages());
478478
self::assertMercureUpdateMatchesJsonSchema(
479479
update: self::getMercureMessage(),
480480
topics: [
@@ -565,7 +565,7 @@ public function asAUserICanDeleteMyBookReview(): void
565565
self::assertResponseStatusCodeSame(Response::HTTP_NO_CONTENT);
566566
self::assertEmpty($response->getContent());
567567
ReviewFactory::assert()->notExists(['body' => 'Best book ever!']);
568-
self::assertCount(1, self::getMercureMessages());
568+
self::assertCount(2, self::getMercureMessages());
569569
self::assertEquals(
570570
new Update(
571571
topics: [

helm/api-platform/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ type: application
1717
# This is the chart version. This version number should be incremented each time you make changes
1818
# to the chart and its templates, including the app version.
1919
# Versions are expected to follow Semantic Versioning (https://semver.org/)
20-
version: 4.2.21
20+
version: 4.3.0
2121

2222
# This is the version number of the application being deployed. This version number should be
2323
# incremented each time you make changes to the application. Versions are not expected to
2424
# follow Semantic Versioning. They should reflect the version the application is using.
25-
appVersion: 4.2.21
25+
appVersion: 4.3.0
2626

2727
dependencies:
2828
- name: postgresql

0 commit comments

Comments
 (0)