Useful extensions for the dedoc/scramble package
Scramble Extensions provides a collection of powerful tools to supercharge your dedoc/scramble documentation. It automates common API documentation tasks like adding security headers, handling multi-tenancy, and providing deep integration for Spatie's Laravel Data DTOs.
- Automation: Automatically add Authorization and Tenant headers to your OpenAPI specification.
- Rich DTO Support: Seamlessly generate schemas for complex DTOs built with
spatie/laravel-data. - Clean Documentation: Keep your controller annotations minimal by letting these extensions handle the global requirements of your API.
- Better DX: Provide a much more accurate and interactive "Try It" experience in your documentation UI.
We invest a lot of resources into creating best in class open source packages. You can support us by sponsoring us on GitHub.
composer require victormgomes/scramble-extensionsRegister the desired extensions in your config/scramble.php file:
//config/scramble.php
return [
// ...
'extensions' => [
\Victormgomes\ScrambleExtensions\Extensions\AddAuthorizationHeader::class,
\Victormgomes\ScrambleExtensions\Extensions\AddTenantHeader::class,
\Victormgomes\ScrambleExtensions\Extensions\SpatieData::class,
],
];- AddAuthorizationHeader: Automatically adds the Bearer token field to authenticated routes.
- AddTenantHeader: Injects the required Tenant-ID header for multi-tenant routes.
- SpatieData: Generates accurate OpenAPI schemas from
spatie/laravel-dataobjects.
composer testPlease see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.