dunglas/json-ld-api-bundle
A Symfony bundle for building JSON-LD and Hydra REST APIs from your entities. It adds schema.org vocabularies, pagination, filtering, validation, and API documentation, making it easy to expose hypermedia-driven web APIs.
Architecture fit. The artifact labeled dunglas/json-ld-api-bundle is effectively the API Platform Core monorepo (api-platform/core), not a narrow JSON-LD bundle. Its value proposition is metadata-driven API generation: annotate a resource once, get JSON-LD/Hydra, OpenAPI, and GraphQL surfaces. For a Laravel codebase, this is a full API framework layered on top of Laravel rather than a utility library. That is a strategic commitment, not a drop-in. Fit is strongest when the product needs standards-compliant hypermedia (JSON-LD, Hydra, HAL) or schema-first GraphQL derived from the same models; it is weak when the team only needs REST JSON with a handful of endpoints.
Integration feasibility. Feasible but non-trivial. The Symfony bundle is not the integration path for Laravel — the Laravel bridge package is — and the bridge is materially less mature than the Symfony bundle. Expect to own: service provider registration, route wiring, Eloquent state providers/processors, pagination and filtering configuration, and serialization context tuning. A 1–2 week spike on a single read-only resource is the right gate before any commitment.
Technical risk.
src/ components. Dependency surface and upgrade blast radius are much larger than the label implies.tests/Fixtures/app, symfony console, Symfony-flavored PHPUnit). Laravel-specific behavior is thinner and less exercised upstream, so edge cases are ours to find.composer link, filtered PHPUnit runs, PHPStan warm-up (must run a test before static analysis), and fixture isolation (new entities only). Patching upstream is a real engineering line item, not a courtesy.Key questions.
Stack fit. Requires modern PHP (8.1+) and a current Laravel major. The package is Composer-installable, but the monorepo layout means we should pin the bridge and core together and treat them as a coupled upgrade unit. JSON-LD output pulls in serializer dependencies; audit transitive packages and licensing (MIT core, but verify bridge and serializer deps).
Migration path. Do not migrate an existing API wholesale. Recommended staged path:
Compatibility. Expect partial feature parity: Symfony-specific DI, event listeners, and some security integrations will not map cleanly. Maintain an explicit compatibility matrix (Laravel version × bridge version × core version × PHP version) and test upgrades against it. JSON-LD consumers (external clients, semantic web tooling) are sensitive to context and @id/@type changes — freeze the vocabulary early.
Sequencing. Bridge-and-core pinning → spike → ADR → pilot → platform ownership → broad rollout. Run GraphQL last; it multiplies schema-stability and performance risk. Keep the existing Laravel API live in parallel behind a routing prefix until the pilot is signed off.
Maintenance. Upstream enforces backward compatibility ("never break BC") and Conventional Commits, which is favorable. But BC guarantees apply to the framework's own contracts, not to our integration glue. Budget ongoing effort for: bridge upgrades, serializer/metadata cache invalidation on deploy, and occasional upstream patches via the monorepo workflow. The AGENTS.md guidance confirms contributing is engineering-heavy: vector search for patterns, filtered test runs only (full suite is too slow), PHPStan after cache warm-up, no fixture edits — all of which implies a contributed fix carries real cycle time.
Support. Community-driven with a commercial vendor behind the framework; no SLA is implied by the package metadata. For a production dependency, define an internal owner and an escalation path. The zero-dependents signal means we should not assume someone else has hit our failure modes first.
Scaling. The HTTP layer is stateless and naturally horizontally scalable. Three scaling concerns are ours to manage:
Failure modes to instrument.
Ramp-up. Realistic estimate: 2–4 weeks for a mid-level engineer to be productive, driven by three unfamiliar concepts — the resource metadata system (attribute-based ApiResource configuration), the state provider/processor pipeline, and JSON-LD/Hydra vocabulary. Add a half-week for the team to internalize the upstream contribution workflow if we intend to patch rather than work around. Given the low opportunity score, gate the investment on a confirmed, specific need for hypermedia or model-derived GraphQL — otherwise native Laravel API tooling delivers more value per engineering week.
How can I help you explore Laravel packages today?