yoanm/jsonrpc-http-server-swagger-doc-sdk
Generate Swagger/OpenAPI documentation for JSON-RPC HTTP servers with this SDK. It integrates with the yoanm JSON-RPC server stack to expose method definitions and schemas as interactive API docs, keeping your RPC endpoints discoverable and testable.
Architecture fit. This is a documentation generator, not a server. Its only correct placement is build/CI time — it reflects over JSON-RPC method definitions and emits a machine-readable spec. That framing determines everything else: the package sits outside the request path, outside runtime concerns, and outside anything Laravel's service container would normally manage.
Fit is strictly conditional on already having committed to the yoanm/jsonrpc-server-sdk family as the source of truth for method definitions. Without that upstream dependency, this package has no input to work from and no value. Laravel itself is REST-shaped — routing, middleware, form requests, API resources, and route:list all assume resourceful endpoints — whereas JSON-RPC collapses everything into a single POST endpoint dispatching on a method field. That's a deliberate architectural trade (strongly-typed method contracts, batching, transport-agnostic clients) that a team should already have made for other reasons. This package is a consequence of that decision, not a justification for it.
Integration feasibility. Low difficulty, high ownership cost. It's framework-agnostic plain PHP installed via Composer, so the integration is roughly: instantiate the generator against the server SDK instance, call a render/serialize method, write JSON (or YAML) to public/ or a storage path, and serve it statically or publish it as a CI artifact. Expect ~50–100 lines of glue wrapped in an Artisan command. There is no service provider, no publishable config, no facade — normal for a framework-agnostic library, but it means nothing is covered by upstream tests at the Laravel seam. You own that glue permanently.
Technical risk.
swagger2openapi conversion step or accept a degraded consumer experience.Key questions.
definitions graph with $ref reuse, or does it inline/duplicate object schemas?yoanm/jsonrpc-server-sdk constraint ranges are supported, and does that resolve cleanly against our Laravel/Symfony pin?Stack fit. Composer + PHP 8.x, no Laravel coupling — technically compatible. Verify the Symfony component constraints against the app's Laravel version before writing any code; a resolution failure is the single most likely reason this spike dies in an hour. Keep the package in require-dev if the generator is only invoked from CI or an admin-only Artisan command, which keeps it out of production dependency resolution.
Migration path. Additive, not a migration. There is no existing artifact this replaces unless the team maintains a hand-written API doc for the RPC surface — in which case, retire that document only after the generated output is verified equivalent, and keep it in git history as the reference. If a REST API exists alongside the JSON-RPC surface, expect two documentation pipelines; do not attempt to merge them into one spec.
Compatibility. Generated 2.0 documents are consumable by Swagger UI, Postman, Insomnia, and swagger-cli validate. They are not consumable by OpenAPI-3-only generators (most modern SDK generators). If downstream client SDK generation is a requirement, add a conversion step and validate the converted output, not the source.
Sequencing.
$ref quality, security schemes, and param coverage. This single step resolves most of the risk above.SpecGenerator::generate(): array). No package classes referenced outside that wrapper.Maintenance. Small dependency footprint, MIT license, recent release cadence. Cost is not in upgrades — it's in the glue and in owning the correctness of generated output. Pin an exact version; a 0.x-style package can change rendering behavior in a patch. Monitor the maintainer's release activity quarterly; a 12-month gap on a single-maintainer package should trigger the exit evaluation.
Support. None commercial. Self-support means the wrapper interface is your real insurance policy: if the package breaks or is abandoned, you reimplement generate() behind the same interface and nothing else in the codebase moves. This is the mitigation that makes the low adoption signal tolerable.
Scaling. Not a runtime concern. Generation is O(methods) and runs in CI seconds. The scaling question is organizational: as the method count grows into the hundreds, spec size and diff noise grow with it — a large generated JSON blob committed to git becomes an unreadable review artifact. At that point move to artifact publication rather than commits.
Failure modes.
Ramp-up. A mid-level PHP developer is productive in under a day — the API surface is small and the concept (describe a method's params, emit a spec) is obvious. The real ramp-up is domain literacy in JSON-RPC itself and in the upstream server SDK's method-definition model; allocate the learning budget there, not to this package. Expect the first iteration to produce a spec that's structurally valid but semantically thin (no examples, no security schemes) unless someone explicitly drives those concerns.
Recommendation. Adopt conditionally, as a build-time-only dependency behind a wrapper interface, gated on the spike confirming output quality and Composer resolution. The opportunity score and 0.4 quality signal are not disqualifying for a generator with zero runtime surface — but they do mean this should never become load-bearing infrastructure without an exit path.
How can I help you explore Laravel packages today?