Skip to content

Commit aac28a4

Browse files
Make blueprint an optional dependency (#52)
Fix up CI image
1 parent 525d2f7 commit aac28a4

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

composer.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
}],
1515
"require": {
1616
"php": "^8.0",
17-
"dingo/blueprint": "~0.4",
1817
"illuminate/routing": "^9.0|^10.0|^11.0",
1918
"illuminate/support": "^9.0|^10.0|^11.0",
2019
"league/fractal": "^0.20"
@@ -33,10 +32,13 @@
3332
"mockery/mockery": "~1.0",
3433
"phpunit/phpunit": "^9.0|^10.0",
3534
"squizlabs/php_codesniffer": "~2.0",
36-
"php-open-source-saver/jwt-auth": "^1.4 | ^2.2"
35+
"php-open-source-saver/jwt-auth": "^1.4 | ^2.2",
36+
"dingo/blueprint": "~0.4"
3737
},
3838
"suggest": {
39-
"php-open-source-saver/jwt-auth": "Protect your API with JSON Web Tokens."
39+
"php-open-source-saver/jwt-auth": "Protect your API with JSON Web Tokens.",
40+
"specialtactics/laravel-api-boilerplate": "API Boilerplate for Laravel",
41+
"dingo/blueprint": "Legacy package which can produce API docs from dingo/api"
4042
},
4143
"autoload": {
4244
"psr-4": {

readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Please note, we do not actively maintain the Lumen support of this project. If y
1515

1616
The Dingo API package is meant to provide you, the developer, with a set of tools to help you easily and quickly build your own API. While the goal of this package is to remain as flexible as possible it still won't cover all situations and solve all problems.
1717

18-
[!Build Status](https://github.com/api-ecosystem-for-laravel/dingo-api/actions/workflows/ci.yml/badge.svg?branch=master)
18+
[![CI Tests](https://github.com/api-ecosystem-for-laravel/dingo-api/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/api-ecosystem-for-laravel/dingo-api/actions)
1919
[![License](https://img.shields.io/packagist/l/api-ecosystem-for-laravel/dingo-api.svg?style=flat-square)](LICENSE)
2020
[![Development Version](https://img.shields.io/packagist/vpre/api-ecosystem-for-laravel/dingo-api.svg?style=flat-square)](https://packagist.org/packages/api-ecosystem-for-laravel/dingo-api)
2121
[![Monthly Installs](https://img.shields.io/packagist/dm/api-ecosystem-for-laravel/dingo-api.svg?style=flat-square)](https://packagist.org/packages/api-ecosystem-for-laravel/dingo-api)

src/Provider/DingoServiceProvider.php

+13-11
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,18 @@ protected function registerTransformer()
186186
*/
187187
protected function registerDocsCommand()
188188
{
189-
$this->app->singleton(\Dingo\Api\Console\Command\Docs::class, function ($app) {
190-
return new Command\Docs(
191-
$app[\Dingo\Api\Routing\Router::class],
192-
$app[\Dingo\Blueprint\Blueprint::class],
193-
$app[\Dingo\Blueprint\Writer::class],
194-
$this->config('name'),
195-
$this->config('version')
196-
);
197-
});
198-
199-
$this->commands([\Dingo\Api\Console\Command\Docs::class]);
189+
if (class_exists(\Dingo\Blueprint\Blueprint::class)) {
190+
$this->app->singleton(\Dingo\Api\Console\Command\Docs::class, function ($app) {
191+
return new Command\Docs(
192+
$app[\Dingo\Api\Routing\Router::class],
193+
$app[\Dingo\Blueprint\Blueprint::class],
194+
$app[\Dingo\Blueprint\Writer::class],
195+
$this->config('name'),
196+
$this->config('version')
197+
);
198+
});
199+
200+
$this->commands([\Dingo\Api\Console\Command\Docs::class]);
201+
}
200202
}
201203
}

0 commit comments

Comments
 (0)