Skip to content

Commit

Permalink
Merge 3.1 into main
Browse files Browse the repository at this point in the history
  • Loading branch information
soyuka committed Sep 19, 2023
2 parents 660955b + 4a3e7e6 commit afe7c39
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 13 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Notes:
* [92a81f024](https://github.com/api-platform/core/commit/92a81f024541054b9322e7457b75c721261e14e0) feat(graphql): allow to disable the introspection query (#5711)
* [d793ffb92](https://github.com/api-platform/core/commit/d793ffb9228a21655ee35f0b90a959f93281a4cf) feat: union/intersect types (#5470)

## v3.1.18

## v3.1.17

### Bug fixes
Expand Down Expand Up @@ -419,7 +421,8 @@ Breaking changes:
* Serializer: `skip_null_values` now defaults to `true`
* Metadata: `Patch` is added to the automatic CRUD
* Symfony: generated route names and operation names changed, route naming can be changed directly within metadata
* Doctrine: remove `@final` annotation from filters and mark them as `final`
## v2.7.14
### Bug fixes
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"willdurand/negotiation": "^3.0"
},
"require-dev": {
"behat/behat": "^3.1",
"behat/behat": "^3.11",
"behat/mink": "^1.9",
"doctrine/cache": "^1.11 || ^2.1",
"doctrine/common": "^3.2.2",
Expand Down Expand Up @@ -95,7 +95,6 @@
"doctrine/orm": "<2.14.0",
"doctrine/mongodb-odm": "<2.4",
"doctrine/persistence": "<1.3",
"symfony/service-contracts": "<3",
"symfony/var-exporter" : "<6.1.1",
"phpunit/phpunit": "<9.5",
"phpspec/prophecy": "<1.15",
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/create-a-custom-doctrine-filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
//
// 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.
//
// 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.
// 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.
//
// 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`.
//
// 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.
// 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.
//
// 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`.
//
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/declare-a-resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Book
}
}

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

namespace App\Playground {
use Symfony\Component\HttpFoundation\Request;
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/doctrine-entity-as-resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use ApiPlatform\Metadata\ApiResource;
use Doctrine\ORM\Mapping as ORM;

// When an ApiResource is declared on an `\ORM\Entity` we have access to [Doctrine filters](https://api-platform.com/docs/core/filters/).
// When an ApiResource is declared on an `\ORM\Entity` we have access to [Doctrine filters](/docs/core/filters/).
#[ApiResource]
#[ApiFilter(OrderFilter::class)]
#[ORM\Entity]
Expand Down
4 changes: 4 additions & 0 deletions docs/guides/extend-openapi-documentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@
// tags: openapi, expert
// ---

// # Extend OpenAPI Documentation
namespace App\ApiResource {
use ApiPlatform\Metadata\Post;
use ApiPlatform\OpenApi\Model\Operation;
use ApiPlatform\OpenApi\Model\RequestBody;
use ApiPlatform\OpenApi\Model\Response;

#[Post(
// To extend the OpenAPI documentation we use an [OpenApi Operation model](/docs/reference/OpenApi/Model/Operation/).
// When a field is not specified API Platform will add the missing informations.
openapi: new Operation(
responses: [
'200' => new Response(description: 'Ok'),
],
summary: 'Add a book to the library.',
description: 'My awesome operation',
// Each of the Operation field that you want to customize has a model in our [OpenApi reference](/docs/reference/).
requestBody: new RequestBody(
content: new \ArrayObject(
[
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/hook-a-persistence-layer-with-a-processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use App\State\BookProcessor;
use App\State\BookProvider;

// We use a `BookProcessor` as the [ApiResource::processor](http://localhost:3000/reference/Metadata/ApiResource#processor) option.
// We use a `BookProcessor` as the [ApiResource::processor](/docs/reference/Metadata/ApiResource#processor) option.
#[ApiResource(processor: BookProcessor::class, provider: BookProvider::class)]
class Book
{
Expand Down
10 changes: 5 additions & 5 deletions docs/guides/provide-the-resource-state.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
// ---

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

namespace App\ApiResource {
use ApiPlatform\Metadata\ApiResource;
use App\State\BookProvider;

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

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

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

return $book;
Expand Down

0 comments on commit afe7c39

Please sign in to comment.