dunglas/api-bundle
API Platform Core is a powerful Symfony bundle for building hypermedia-driven REST and GraphQL APIs. It supports JSON-LD, Hydra, OpenAPI, JSON:API, HAL and Problem Details, letting you create fully featured, high-performance API-first projects in minutes.
QueryCollection constructor propagation), which reduces drift between REST and GraphQL contracts.fix(laravel): accept null on an optional belongsTo (#8666, first-time contributor) — plus Laravel test-suite work (createOne() for the for() relation, #8718). This is now the fourth consecutive patch landing Laravel-specific fixes, which materially supports the "feasible, not first-class" position.mixed now emits an empty schema (#8670), intersection types use allOf (#8653), gen_id nesting follows the property (#8644), nested resources respect the output DTO (#8652), and operation groups are retained in context (#8643). For teams generating clients from OpenAPI, contract accuracy improves noticeably.Put::withAllowCreate() and Link::withFromProperty() return new instances (#8685), defaults using can* getters are applied (#8691), queryParameterValidationEnabled is preserved on ApiResource (#8692), the parameter provider is no longer overridden by the filter provider (#8689), and contentNegotiation is copied in withOperation() (#8694). Net effect: custom filters/serializers configured via immutable builders should stop being silently dropped.Add support for GroupSequence (#8645) plus 422 responses for backed enum errors (#8656) and empty scalar params (#8675) give a more coherent, standards-aligned error surface — but change what clients receive.belongsTo nullability, relation test coverage), but Symfony-specific services (PropertyInfo, EventDispatcher) still require manual overrides. Treat the Laravel provider as supported-but-thin, not parity.fix(metadata): allow GraphQL operations in parameter attributes on properties (#8621) means GraphQL operations are permitted, and #8624 additionally accepts operation class names (not just identifiers). Resources that failed the v5.0.2 smoke test may now pass; conversely, class-name references introduce a new typo/refactor surface that static analysis won't catch.read the column default option with doctrine/orm 3 (#8705), accept SortDirection enum in ordering (#8662), use ON for arbitrary join in links (#8672), left join nested props in OrFilter (#8674), accept resolved resources in links (#8687), put-create under a slug parent link (#8688), and portable LIKE escape chars (#8671). Nested-property filtering and slug-parent writes were previously unreliable.reset the skolem IRI converter between requests (#8681) and reset the Mercure publisher between requests (#8684) confirm per-request state bleed was real in the Symfony bridge. If we run Laravel Octane/RoadRunner/Swoole, we must verify equivalent reset behavior in the Laravel provider — this is now a first-order integration question, not an optimization.IriConverter/metadata caching still require tuning; the v5.0.2 HTTP-cache tag wiring remains the de-risking factor.| Risk Area | Severity | Mitigation |
|---|---|---|
| Symfony-Laravel Gaps | High | Test Eloquent integration early; expect manual overrides for Symfony-specific services (e.g., PropertyInfo). |
| Undeclared-Operation Parameter Attribute | Medium → Low-Medium (v5.0.4) | GraphQL operations are now allowed (#8621) and operation class names are accepted (#8624); still run a full route/resource smoke test and prefer class-name references over string identifiers for IDE/refactor safety. |
| Parameter Precedence Drift (new in v5.0.4) | Medium | #8623 makes operation parameters win over property attributes — diff resources that define both; add contract tests asserting the effective parameter set. |
| HTTP Status Semantics Change (new in v5.0.4) | Medium | Empty scalar params now return 422 (#8675) and backed enum validation errors return 422 (#8656); update client error handling and document the change in the API changelog. |
| Long-Running Worker State Bleed (new in v5.0.4) | Medium-High | #8681/#8684 reset skolem IRI converter and Mercure publisher per request on Symfony; verify the Laravel provider does the same under Octane or avoid Octane for API Platform routes initially. |
| Collection Authorization Drift | Medium | v5.0.2 changed non-paginated collection authorization to the resource class; still requires regression tests and policy re-audit. |
| Nested Filter / Relation Joins | Low-Medium (improved) | OrFilter nested left joins (#8674), ON joins in links (#8672), and resolved-resource links (#8687) are fixed; re-run nested-property filter tests before relying on them. |
| Immutable Builder Semantics | Low (improved) | withAllowCreate()/withFromProperty() now return new instances (#8685); audit any code that relied on mutation-in-place. |
| Validation Overrides | Low | Adopt DTOs/state providers; GroupSequence (#8645) and JSON Schema validation groups (#8643) now behave predictably. |
| Performance Regression | Medium | Benchmark serialization/deserialization with large payloads; re-baseline after the JSON Schema changes. |
SortDirection ordering are supported?withAllowCreate, withFromProperty) get chained?IriConverter, metadata, and HTTP cache tags, and does the collection purge cover every collection operation?PartialDenormalizationException::getErrors()?stateOptions/map propagation into the QueryCollection parent constructor, so state-provider-backed collections should behave consistently across REST and GraphQL./api/graphql).@ApiResource; test CRUD, pagination, filtering — including nested-property OrFilter and slug-parent put-create (#8688), both fixed in this release.mixed, intersection types, nested gen_id, nested output DTOs, and array query params.QueryCollection state options/mapping (#8693) and collection-level readableLink/writableLink on non-resource classes (#8706).UuidFilter, ComparisonFilter); confirm the filter provider no longer overrides the parameter provider (#8689) and that generated filter classes are clean.IriConverter, metadata, and HTTP cache tags; confirm collection purges fan out to every collection operation.| Laravel Feature | API Platform Support | Workaround |
|---|---|---|
| Eloquent Relations | ✅ (with fixes) | @ApiProperty for custom relation logic; optional belongsTo now accepts null (#8666). |
| Eloquent Schema Drift / Missing Tables | ✅ (v5.0.2) | Refresh metadata cache after migrations; missing-table metadata is no longer cached. |
| Laravel HTTP Cache / Tagged Invalidation | ✅ (v5.0.2) | Tags processor wired; verify driver parity (Redis vs. file) and collection purge coverage. |
| Laravel Octane / Long-Running Workers | ⚠️ (unverified) | Per-request reset exists for Symfony-only services (#8681, #8684); validate Laravel provider or stay on FPM. |
| Laravel Scout (Search) | ❌ | Implement custom SearchFilter. |
| Laravel Notifications | ❌ | Webhooks or GraphQL subscriptions. |
| Laravel Horizon (Queues) | ❌ | Offload async work via Laravel Queues. |
| PHPUnit 13 / ApiTestCase | ⚠️ → ✅ (v5.0.4) | Import ApiPlatform\Test\ApiTestCase (#8708) and drop with()-based Hydra resolver stubs (#8707). |
| Laravel Mix / Vite | ❌ | Keep frontend assets separate; use API Platform docs for the API surface. |
@ApiResource classes.OrFilter, portable LIKE escaping), pagination, non-paginated collection authz, and the new 422 paths.QueryCollection state mapping, link readability/writability on collection members.SortDirection enum), reducing local overlays. Symfony-only fixes remain the majority by volume.belongsTo nullability pattern and Octane findings if we validate them.ApiTestCase import, Hydra resolver stubs) is now handled upstream — remove local shims.debug:api for metadata inspection; Laravel tinker for Eloquent/API Platform interaction. New wrinkle: when a parameter value looks wrong, check provider precedence (filter vs. parameter, #8689) and operation vs. property precedence (#8623) before assuming a bug.allOf for intersections, empty schema for mixed) since schema generation cost is startup-time but payload shape affects serialization.IriConverter, metadata, and HTTP cache tags; OPcache for serializer. The collection-wide purge fix (v5.0.2) plus resolved-resource link handling (#8687) reduce stale-link risk under load.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Symfony-Laravel Integration Bug | High (API breaks) | Test Eloquent edge cases; stay on the latest 5.0.x patch. |
| Non-Paginated Collection Authz Regression (v5.0.2) | High (data exposure) | Explicit authz tests per collection operation; re-audit voters/policies. |
| Silent Parameter Precedence Change (#8623) | High (wrong filters/validation applied) | Snapshot effective parameters per resource pre/post upgrade; assert in contract tests. |
| 422 Contract Drift (#8675, #8656) | Medium (client breakage) | Update SDK error maps; document in the API changelog; add integration tests on empty-scalar and enum paths. |
| Long-Running Worker State Bleed (Octane) | High (cross-request data leakage) | Verify per-request reset in the Laravel provider (#8681, #8684 analogs) or run FPM; add a two-request soak test. |
| Undeclared-Operation Parameter Attribute | Low-Medium (was High in v5.0.2) | GraphQL operations now allowed (#8621); prefer class names (#8624); keep the smoke test in CI. |
| GraphQL-REST Route Conflict | Medium (404/500) | Prefix routes (e.g., /api/graphql). |
| Caching Invalidation Issues | Medium (stale data) | Redis TTL or tag-based invalidation; verify collection purge covers every collection operation. |
| Nested Filter Join Errors | Low-Medium (improved) | Covered by #8674/#8672 fixes; add nested-property filter tests. |
| Validation Conflicts | Low | Align on DTO/state-provider validation; use validation groups and GroupSequence. |
How can I help you explore Laravel packages today?