Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions core/doctrine-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -1373,8 +1373,8 @@ class Offer
```

`DateFilter` is kept: only the declaration style changes. The URL syntax is unchanged
(`?createdAt[before]=2025-01-01`, `?createdAt[after]=2025-01-01`, and the `strictly_*` variants), and
per-property null management still applies.
(`?createdAt[before]=2025-01-01`, `?createdAt[after]=2025-01-01`, and the `strictly_*` variants),
and per-property null management still applies.

### Example: Migrating a RangeFilter

Expand Down
38 changes: 19 additions & 19 deletions core/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,22 +308,22 @@ class Book
# api/config/api_platform/resources/Book.yaml
App\ApiResource\Book:
normalizationContext:
groups: ['get']
groups: ["get"]
operations:
ApiPlatform\Metadata\Get: ~
ApiPlatform\Metadata\Get: ~
ApiPlatform\Metadata\Patch:
normalizationContext:
groups: ['patch']
groups: ["patch"]

# The YAML syntax is only supported for Symfony
# api/config/serializer/Book.yaml
App\ApiResource\Book:
attributes:
name:
groups: ['get', 'patch']
groups: ["get", "patch"]
author:
groups: ['get']
groups: ["get"]
```

```xml
Expand Down Expand Up @@ -452,16 +452,16 @@ class Book
# api/config/api_platform/resources/Book.yaml
App\ApiResource\Book:
normalizationContext:
groups: ['book']
groups: ["book"]

# The YAML syntax is only supported for Symfony
# api/config/serializer/Book.yaml
App\ApiResource\Book:
attributes:
name:
groups: ['book']
groups: ["book"]
author:
groups: ['book']
groups: ["book"]
```

</code-selector>
Expand Down Expand Up @@ -597,18 +597,18 @@ class Person
# api/config/api_platform/resources/Person.yaml
App\ApiResource\Person:
normalizationContext:
groups: ['person']
groups: ["person"]
denormalizationContext:
groups: ['person']
groups: ["person"]

# The YAML syntax is only supported for Symfony
# api/config/serializer/Person.yaml
App\ApiResource\Person:
attributes:
name:
groups: ['person']
groups: ["person"]
parent:
groups: ['person']
groups: ["person"]
```

</code-selector>
Expand Down Expand Up @@ -870,18 +870,18 @@ App\Entity\Greeting:
operations:
ApiPlatform\Metadata\GetCollection:
normalizationContext:
groups: 'greeting:collection:get'
groups: "greeting:collection:get"

# The YAML syntax is only supported for Symfony
# api/config/serializer/Greeting.yaml
App\Entity\Greeting:
attributes:
id:
groups: 'greeting:collection:get'
groups: "greeting:collection:get"
name:
groups: 'greeting:collection:get'
groups: "greeting:collection:get"
sum:
groups: 'greeting:collection:get'
groups: "greeting:collection:get"
```

</code-selector>
Expand Down Expand Up @@ -932,18 +932,18 @@ class Book
# api/config/api_platform/resources/Book.yaml
App\ApiResource\Book:
normalizationContext:
groups: ['book:output']
groups: ["book:output"]
denormalizationContext:
groups: ['book:input']
groups: ["book:input"]

# The YAML syntax is only supported for Symfony
# api/config/serializer/Book.yaml
App\ApiResource\Book:
attributes:
active:
groups: ['book:output', 'admin:input']
groups: ["book:output", "admin:input"]
name:
groups: ['book:output', 'book:input']
groups: ["book:output", "book:input"]
```

</code-selector>
Expand Down
6 changes: 3 additions & 3 deletions core/state-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,13 +435,13 @@ use the following snippet:
services:
# ...
App\State\BlogPostProvider:
tags: [ 'api_platform.state_provider' ]
tags: ["api_platform.state_provider"]

# api/config/services.yaml
services:
# ...
App\State\BookRepresentationProvider:
arguments:
$itemProvider: '@api_platform.doctrine.orm.state.item_provider'
tags: [ 'api_platform.state_provider' ]
$itemProvider: "@api_platform.doctrine.orm.state.item_provider"
tags: ["api_platform.state_provider"]
```
13 changes: 7 additions & 6 deletions core/upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ upgrade to the next major a no-op.

The legacy Doctrine filter API is deprecated in favor of parameter-based filters declared with the
`#[QueryParameter]` attribute. The `#[ApiFilter]` attribute, the `Operation::$filters` property, and
the `AbstractFilter` base class (Doctrine ORM and MongoDB ODM) are all deprecated and removed in 6.0.
the `AbstractFilter` base class (Doctrine ORM and MongoDB ODM) are all deprecated and removed in
6.0.

There are two kinds of migration:

- **Replaced filters** — removed in 6.0, swap the class:

| Legacy filter | Replacement |
| ------------- | ----------- |
| `SearchFilter` | `ExactFilter` / `PartialSearchFilter` / `IriFilter` (depending on the strategy) |
| `BooleanFilter`, `NumericFilter`, `BackedEnumFilter` | `ExactFilter` |
| `OrderFilter` | `SortFilter` |
| Legacy filter | Replacement |
| ---------------------------------------------------- | ------------------------------------------------------------------------------- |
| `SearchFilter` | `ExactFilter` / `PartialSearchFilter` / `IriFilter` (depending on the strategy) |
| `BooleanFilter`, `NumericFilter`, `BackedEnumFilter` | `ExactFilter` |
| `OrderFilter` | `SortFilter` |

- **Kept filters** — `DateFilter`, `RangeFilter` and `ExistsFilter` survive. Only the way you
_declare_ them is deprecated: move the declaration from `#[ApiFilter]` to `#[QueryParameter]`. The
Expand Down
Loading