devSSI's avatar

Laravel package for api contracts

One thing that always worried me when working, especially on APIs, was accidentally introducing breaking changes.

Sometimes, a renamed field, or a removed property, or even changing the type of the property can easily break client applications without anyone noticing until it's too late.

So I built the package, Laravel API Contracts. The package uses snapshot testing to capture the structure of your API responses. Every push automatically verifies that existing response contracts haven't been broken.

āœ… Detects removed fields āœ… Detects type changes āœ… Allows additive changes without blocking your workflow āœ… Integrates with Git hooks to catch issues before they reach production

The snapshots are simple JSON files committed to your repository, making every API contract change visible in code reviews.

This is my first public open-source package, and I'd really appreciate any feedback or suggestions.

šŸ“¦ https://packagist.org/packages/ssdev/laravel-api-contracts

0 likes
0 replies

Please or to participate in this conversation.