Skip to content

Commit b66fdcf

Browse files
authored
Merge pull request #5839 from soyuka/mrege
Merge 3.1 into main
2 parents 660955b + afe7c39 commit b66fdcf

8 files changed

+19
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Notes:
4040
* [92a81f024](https://github.com/api-platform/core/commit/92a81f024541054b9322e7457b75c721261e14e0) feat(graphql): allow to disable the introspection query (#5711)
4141
* [d793ffb92](https://github.com/api-platform/core/commit/d793ffb9228a21655ee35f0b90a959f93281a4cf) feat: union/intersect types (#5470)
4242

43+
## v3.1.18
44+
4345
## v3.1.17
4446

4547
### Bug fixes
@@ -419,7 +421,8 @@ Breaking changes:
419421
* Serializer: `skip_null_values` now defaults to `true`
420422
* Metadata: `Patch` is added to the automatic CRUD
421423
* Symfony: generated route names and operation names changed, route naming can be changed directly within metadata
422-
424+
* Doctrine: remove `@final` annotation from filters and mark them as `final`
425+
423426
## v2.7.14
424427
425428
### Bug fixes

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"willdurand/negotiation": "^3.0"
2929
},
3030
"require-dev": {
31-
"behat/behat": "^3.1",
31+
"behat/behat": "^3.11",
3232
"behat/mink": "^1.9",
3333
"doctrine/cache": "^1.11 || ^2.1",
3434
"doctrine/common": "^3.2.2",
@@ -95,7 +95,6 @@
9595
"doctrine/orm": "<2.14.0",
9696
"doctrine/mongodb-odm": "<2.4",
9797
"doctrine/persistence": "<1.3",
98-
"symfony/service-contracts": "<3",
9998
"symfony/var-exporter" : "<6.1.1",
10099
"phpunit/phpunit": "<9.5",
101100
"phpspec/prophecy": "<1.15",

docs/guides/create-a-custom-doctrine-filter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
//
1212
// 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.
1313
//
14-
// 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.
14+
// 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.
1515
//
1616
// 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`.
1717
//
18-
// 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.
18+
// 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.
1919
//
2020
// 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`.
2121
//

docs/guides/declare-a-resource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Book
4646
}
4747
}
4848

49-
// Check our next guide to [provide the resource state](./provide-the-resource-state).
49+
// Check our next guide to [provide the resource state](/playground/provide-the-resource-state).
5050

5151
namespace App\Playground {
5252
use Symfony\Component\HttpFoundation\Request;

docs/guides/doctrine-entity-as-resource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use ApiPlatform\Metadata\ApiResource;
1818
use Doctrine\ORM\Mapping as ORM;
1919

20-
// When an ApiResource is declared on an `\ORM\Entity` we have access to [Doctrine filters](https://api-platform.com/docs/core/filters/).
20+
// When an ApiResource is declared on an `\ORM\Entity` we have access to [Doctrine filters](/docs/core/filters/).
2121
#[ApiResource]
2222
#[ApiFilter(OrderFilter::class)]
2323
#[ORM\Entity]

docs/guides/extend-openapi-documentation.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,23 @@
77
// tags: openapi, expert
88
// ---
99

10+
// # Extend OpenAPI Documentation
1011
namespace App\ApiResource {
1112
use ApiPlatform\Metadata\Post;
1213
use ApiPlatform\OpenApi\Model\Operation;
1314
use ApiPlatform\OpenApi\Model\RequestBody;
1415
use ApiPlatform\OpenApi\Model\Response;
1516

1617
#[Post(
18+
// To extend the OpenAPI documentation we use an [OpenApi Operation model](/docs/reference/OpenApi/Model/Operation/).
19+
// When a field is not specified API Platform will add the missing informations.
1720
openapi: new Operation(
1821
responses: [
1922
'200' => new Response(description: 'Ok'),
2023
],
2124
summary: 'Add a book to the library.',
2225
description: 'My awesome operation',
26+
// Each of the Operation field that you want to customize has a model in our [OpenApi reference](/docs/reference/).
2327
requestBody: new RequestBody(
2428
content: new \ArrayObject(
2529
[

docs/guides/hook-a-persistence-layer-with-a-processor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use App\State\BookProcessor;
1515
use App\State\BookProvider;
1616

17-
// We use a `BookProcessor` as the [ApiResource::processor](http://localhost:3000/reference/Metadata/ApiResource#processor) option.
17+
// We use a `BookProcessor` as the [ApiResource::processor](/docs/reference/Metadata/ApiResource#processor) option.
1818
#[ApiResource(processor: BookProcessor::class, provider: BookProvider::class)]
1919
class Book
2020
{

docs/guides/provide-the-resource-state.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
// ---
99

1010
// # Provide the Resource State
11-
// Our model is the same then in the previous guide ([Declare a Resource](./declare-a-resource). API Platform will declare
11+
// Our model is the same then in the previous guide ([Declare a Resource](/playground/declare-a-resource). API Platform will declare
1212
// CRUD operations if we don't declare them.
1313

1414
namespace App\ApiResource {
1515
use ApiPlatform\Metadata\ApiResource;
1616
use App\State\BookProvider;
1717

18-
// We use a `BookProvider` as the [ApiResource::provider](/reference/Metadata/ApiResource#provider) option.
18+
// We use a `BookProvider` as the [ApiResource::provider](/docs/reference/Metadata/ApiResource#provider) option.
1919
#[ApiResource(provider: BookProvider::class)]
2020
class Book
2121
{
@@ -39,14 +39,14 @@ public function provide(Operation $operation, array $uriVariables = [], array $c
3939
$book = new Book();
4040
$book->id = '1';
4141

42-
// $book2 = new Book();
43-
// $book2->id = '2';
42+
/** $book2 = new Book();
43+
$book2->id = '2'; */
4444
// As an exercise you can edit the code and add a second book in the collection.
4545
return [$book/* $book2 */];
4646
}
4747

4848
$book = new Book();
49-
// The value at `$uriVariables['id']` is the one that matches the `{id}` variable of the **[URI template](/explanation/uri#uri-template)**.
49+
// The value at `$uriVariables['id']` is the one that matches the `{id}` variable of the **[URI template](/docs/core/subresources/)**.
5050
$book->id = $uriVariables['id'];
5151

5252
return $book;

0 commit comments

Comments
 (0)