Skip to content

Commit 30c7f73

Browse files
committed
Document Symfony 8.x compatibility status and Behat ecosystem blocker
Adds notes explaining: - Bundle code is Symfony 8.x-compatible - Test suite is capped at Symfony 7.x by behat/behat and friends-of-behat/symfony-extension not yet supporting ^8.0 - Symfony 8.2 null-for-typed-string behaviour and the AP4 nullable metadata interaction that requires ?string + nullable ORM column
1 parent 38614c8 commit 30c7f73

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ This factory (`src/ApiPlatform/Metadata/Resource/RoutingPrefixResourceMetadataCo
100100
- **`application/problem+json`** is the correct Content-Type for any 4xx/5xx response generated by AP4's exception handler (`rfc_7807_compliant_errors: true` is the default in AP4 4.x). Only responses serialised normally (non-exception path) carry `application/ld+json`.
101101
- **Constraint constructors** (`Count`, `Length`, `NotBlank`, etc.) must use named arguments in Symfony 8.x — the array-options style (`new Count(['min' => 1])`) throws `TypeError`. Use `new Count(min: 1, minMessage: '...')`.
102102
- **`api_sub_level` context**: when normalising a sub-object (e.g. `ResourceMetadata` inside `MetadataNormalizer`), set `$context['api_sub_level'] = true`. Without it, `PartialCollectionViewNormalizer` injects a `"view": {"@type": "PartialCollectionView"}` entry into any array property whenever the request URI has query parameters, turning the array into a JSON object.
103+
- **Symfony 8.2 null-for-typed-string**: Symfony 8.2 converts a null value for a non-nullable typed string property into a proper validation violation rather than a raw TypeError. Prefer `?string = null` (nullable PHP type + nullable ORM column) so null passes through deserialization to the `#[Assert\NotBlank]` validator consistently across all Symfony versions. AP4's `AbstractItemNormalizer` reads serializer metadata (including the ORM `nullable` flag), so `?string` with `nullable: false` on the ORM column still triggers the TypeError path.
104+
- **Behat / Symfony 8.x**: The `behat/behat` and `friends-of-behat/symfony-extension` packages do not yet support Symfony 8.x (their constraints cap at `^7.0`). This holds `symfony/console`, `symfony/event-dispatcher`, `symfony/property-access`, `symfony/http-kernel`, and the full security stack at 7.x in the test environment. The production bundle code is Symfony 8.x-compatible; only the test tooling is blocked. Watch for a `behat/behat` 4.x stable release or updated `friends-of-behat/symfony-extension` to unblock.
103105

104106
### Serialization groups
105107

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515

1616
### **[Read the documentation](https://docs.api.cwa.rocks/)**
1717

18+
## Requirements
19+
20+
- PHP 8.2+
21+
- Symfony 7.4+ (bundle code is Symfony 8.x-compatible; test suite is currently capped at Symfony 7.x by `behat/behat` and `friends-of-behat/symfony-extension` not yet supporting Symfony 8.x)
22+
1823
## Sponsors
1924

2025
[![Blackfire](./docs/images/blackfire-io_secondary_horizontal_transparent.png)](https://blackfire.io/)

0 commit comments

Comments
 (0)