Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions core/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ To deprecate a resource class, use the `deprecationReason` attribute:

```php
<?php
// api/src/Entity/Parchment.php
namespace App\Entity;
// api/src/ApiResource/Parchment.php with Symfony or app/ApiResource/Parchment.php with Laravel
namespace App\ApiResource;

use ApiPlatform\Metadata\ApiResource;

Expand Down Expand Up @@ -51,8 +51,8 @@ You can also use this new `deprecationReason` attribute to deprecate specific [o

```php
<?php
// api/src/Entity/Parchment.php
namespace App\Entity;
// api/src/ApiResource/Parchment.php with Symfony or app/ApiResource/Parchment.php with Laravel
namespace App\ApiResource;

use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
Expand All @@ -71,8 +71,8 @@ It's also possible to deprecate a single property:

```php
<?php
// api/src/Entity/Review.php
namespace App\Entity;
// api/src/ApiResource/Review.php with Symfony or app/ApiResource/Review.php with Laravel
namespace App\ApiResource;

use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\ApiProperty;
Expand All @@ -91,9 +91,10 @@ class Review

```yaml
# api/config/api_platform/resources/Review.yaml
# The YAML syntax is only supported for Symfony
properties:
# ...
App\Entity\Review:
App\ApiResource\Review:
# ...
letter:
deprecationReason: 'Use the rating property instead'
Expand All @@ -114,8 +115,8 @@ Thanks to the `sunset` attribute, API Platform makes it easy to set this header

```php
<?php
// api/src/Entity/Parchment.php
namespace App\Entity;
// api/src/ApiResource/Parchment.php with Symfony or app/ApiResource/Parchment.php with Laravel
namespace App\ApiResource;

use ApiPlatform\Metadata\ApiResource;

Expand All @@ -136,8 +137,8 @@ It's also possible to set the `Sunset` header only for a specific [operation](op

```php
<?php
// api/src/Entity/Parchment.php
namespace App\Entity;
// api/src/ApiResource/Parchment.php with Symfony or app/ApiResource/Parchment.php with Laravel
namespace App\ApiResource;

use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
Expand All @@ -162,8 +163,8 @@ You can prefix your URI Templates and change the representation using serializat

```php
<?php
// api/src/Entity/Parchment.php
namespace App\Model;
// api/src/ApiResource/Parchment.php with Symfony or app/ApiResource/Parchment.php with Laravel
namespace App\ApiResource;

use ApiPlatform\Metadata\Get;
use Symfony\Component\Serializer\Attrbute\Groups;
Expand Down