yoanm/jsonrpc-params-symfony-validator-sdk
Symfony Validator integration for JSON-RPC params: validate incoming request parameters against Symfony validation constraints and mapping rules, with clean violation handling for yoanm/jsonrpc-server-sdk.
-32602 Invalid params error with structured data — a decision that gets locked in early and is expensive to reshape later.Assert\Type, Assert\NotBlank, Assert\Valid, and custom constraints for RPC params, while Laravel's Illuminate\Validation rules handle HTTP form/API validation. That's two validation dialects in one codebase — a real maintainability cost that should be an explicit, documented decision rather than an accident.Adopt if:
yoanm/php-jsonrpc-server-sdk (or equivalent) and need a params validator that satisfies its interface without hand-rolling one.Look elsewhere if:
Illuminate\Validation already covers 90% of this; a ~50-line adapter implementing the same interface avoids introducing a second validation paradigm and a Symfony service-container bootstrap inside Laravel.opis/json-schema or justinrainbow/json-schema.To executives: A small, MIT-licensed adapter that lets us validate JSON-RPC request parameters using a mature, widely-used validation library instead of custom code — less bespoke logic, fewer validation bugs, faster delivery on any RPC-facing feature. Cost is near zero; the risk is maintenance (one maintainer, negligible adoption), mitigated by the tiny surface area and the fact that swapping in our own adapter is roughly a day of work. Recommendation: approve as a timeboxed spike inside an existing initiative, not as a standalone standards decision.
To engineering: It's a thin bridge between the yoanm JSON-RPC SDK's params-validator interface and Symfony Validator — you get declarative constraints, nested validation, groups, and i18n violation messages for free. Be clear-eyed on three things: (1) it's Symfony-flavored inside a Laravel app, so we own bootstrapping the Validator, translation, and mapping ConstraintViolationList into JSON-RPC error data; (2) it introduces a second validation dialect alongside Illuminate\Validation — a deliberate trade, not an oversight; (3) we should assume we may need to fork it, so keep our usage confined to the interface boundary and cover it with contract tests. Default position: build the adapter ourselves unless we've already standardized on the yoanm SDK stack.
How can I help you explore Laravel packages today?