eleven-labs/api-validator
PHP library for validating PSR-7 HTTP requests and responses against OpenAPI/Swagger 2.0 schemas. It checks headers, query parameters, URI, and body using JSON Schema, helping ensure API messages conform to your specification.
headers, query, uri, body) and responses (headers, body) are checked against the published contract. This is the evidence needed to decide whether to standardize on spec-first workflows across teams.FormRequest rules, custom middleware, and bespoke validators with a schema-driven approach. Useful for estimating the maintenance cost of validation code you would otherwise own.Consider it when:
symfony/psr-http-message-bridge adapter and custom middleware/exception mapping).justinrainbow/json-schema) over a heavier framework.Look elsewhere when:
league/openapi-psr7-validator or cebe/php-openapi.For executives: "We can make our API specification executable instead of aspirational. Adopting this library lets us validate live requests and responses against our published Swagger contract, reducing custom validation code and catching spec/implementation drift before customers do. Cost is low — one MIT-licensed dependency — but the project is small and lightly maintained, so I recommend a short proof of concept, isolating it behind our own validation interface, and keeping a migration path to a more actively maintained validator. Net: a cheap experiment with a bounded downside, not a platform bet."
For engineering: "It's a focused library that validates PSR-7 requests and responses against Swagger 2.0 using json-schema — fits as HTTP middleware and as a contract-test helper. Caveats: Swagger 2.0 only, no native Laravel integration (needs a PSR-7 bridge and our own middleware/exception handling), and the project shows low adoption and limited maintenance signal. Proposal: wrap it behind an internal ContractValidator interface, run a POC on one service, and benchmark against league/openapi-psr7-validator before committing. That gives us the option value without the lock-in."
How can I help you explore Laravel packages today?