carsdotcom/laravel-json-schema
Adds JSON Schema validation to Laravel, letting you validate request data and other payloads against reusable schemas with Laravel-native errors—ideal for enforcing API contracts and keeping payload rules consistent.
The v3.0.1 release adds a normalizeWithJsonSerializable flag to the normalization path. Defaulting to true preserves existing behavior, so this is a low-risk, backwards-compatible feature rather than a breaking change. For a TPM, the main value is an explicit performance/correctness trade-off: teams can keep full JsonSerializable semantics by default, or disable them for extremely large payloads to use Opis Helper::toJson for lower memory use and faster serialization.
JsonSerializable, Eloquent models, or JSON model abstractions. The flag creates a controlled escape hatch without changing the default normalization contract.false. The release notes explicitly warn that this mode misses unusual JsonSerializable contracts such as Models or JsonModels. That can produce incomplete or differently shaped payloads, which may break downstream consumers, validation, signatures, or cached representations.JsonSerializable? Are Eloquent models and custom JsonModels covered by regression tests in both modes? What is the performance/memory benchmark behind “extremely large payloads”? Does false alter API response contracts for existing endpoints? Is there a documented compatibility matrix for Laravel/PHP versions?The package remains a straightforward Laravel/PHP dependency upgrade. The default-true behavior means the safe migration path is to upgrade first, validate no behavioral drift, then selectively evaluate normalizeWithJsonSerializable = false only where payload size and memory pressure justify it.
JsonSerializable implementations, or large API payloads. The Opis fallback path is relevant for high-throughput or memory-constrained environments.JsonSerializable normalization, especially endpoints returning Eloquent models or JsonModels.true against current production outputs.false on a narrow, non-contract-critical endpoint.true.Operationally, this release is low-maintenance and low-ramp-up. It does not force immediate behavior changes, but it introduces a new configuration surface that must be governed. The TPM should treat normalizeWithJsonSerializable = false as a performance optimization with correctness implications, not as a general-purpose default.
false need documentation, ownership, and tests for affected normalization paths.false broadly. The main support risk is hard-to-diagnose payload shape differences when models or custom JSON serializers are involved.false is used intentionally. It can reduce memory pressure and improve throughput, but only if the payload contract does not depend on richer JsonSerializable behavior.true still carries the pre-existing memory cost for very large payloads.How can I help you explore Laravel packages today?