From 73ca9f41b0a357930c9fc5ad8b68fb8cd98f94b2 Mon Sep 17 00:00:00 2001 From: Jan Felix Wiebe Date: Sat, 23 Nov 2019 02:37:37 +0100 Subject: [PATCH] added api generator for backend --- .gitignore | 2 + bootstrap/app.php | 2 + composer.json | 3 +- composer.lock | 1224 +++++++++++++++++++++++++++++++++++++++++++-- config/apidoc.php | 245 +++++++++ 5 files changed, 1426 insertions(+), 50 deletions(-) create mode 100644 config/apidoc.php diff --git a/.gitignore b/.gitignore index 059a517..2dccac6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ Homestead.json Homestead.yaml .env +/public/docs +/resources/docs \ No newline at end of file diff --git a/bootstrap/app.php b/bootstrap/app.php index 3882537..48de537 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -79,6 +79,8 @@ $app->singleton( // $app->register(App\Providers\AppServiceProvider::class); // $app->register(App\Providers\AuthServiceProvider::class); // $app->register(App\Providers\EventServiceProvider::class); +$app->register(\Mpociot\ApiDoc\ApiDocGeneratorServiceProvider::class); +$app->configure('apidoc'); /* |-------------------------------------------------------------------------- diff --git a/composer.json b/composer.json index 2eebd52..a00ce6b 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,8 @@ "type": "project", "require": { "php": "^7.2", - "laravel/lumen-framework": "^6.0" + "laravel/lumen-framework": "^6.0", + "mpociot/laravel-apidoc-generator": "^4.0" }, "require-dev": { "fzaninotto/faker": "^1.4", diff --git a/composer.lock b/composer.lock index 7868678..014eca8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "91fc8c41226ea4e534ebfc160f2acc8c", + "content-hash": "2a3b4ef84bea8aab661ffb93770c5864", "packages": [ { "name": "doctrine/inflector", @@ -247,6 +247,161 @@ ], "time": "2019-08-13T17:33:27+00:00" }, + { + "name": "erusev/parsedown", + "version": "1.7.3", + "source": { + "type": "git", + "url": "https://github.com/erusev/parsedown.git", + "reference": "6d893938171a817f4e9bc9e86f2da1e370b7bcd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/erusev/parsedown/zipball/6d893938171a817f4e9bc9e86f2da1e370b7bcd7", + "reference": "6d893938171a817f4e9bc9e86f2da1e370b7bcd7", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35" + }, + "type": "library", + "autoload": { + "psr-0": { + "Parsedown": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Emanuil Rusev", + "email": "hello@erusev.com", + "homepage": "http://erusev.com" + } + ], + "description": "Parser for Markdown.", + "homepage": "http://parsedown.org", + "keywords": [ + "markdown", + "parser" + ], + "time": "2019-03-17T18:48:37+00:00" + }, + { + "name": "filp/whoops", + "version": "2.5.0", + "source": { + "type": "git", + "url": "https://github.com/filp/whoops.git", + "reference": "cde50e6720a39fdacb240159d3eea6865d51fd96" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/filp/whoops/zipball/cde50e6720a39fdacb240159d3eea6865d51fd96", + "reference": "cde50e6720a39fdacb240159d3eea6865d51fd96", + "shasum": "" + }, + "require": { + "php": "^5.5.9 || ^7.0", + "psr/log": "^1.0.1" + }, + "require-dev": { + "mockery/mockery": "^0.9 || ^1.0", + "phpunit/phpunit": "^4.8.35 || ^5.7", + "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0" + }, + "suggest": { + "symfony/var-dumper": "Pretty print complex values better with var-dumper available", + "whoops/soap": "Formats errors as SOAP responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-4": { + "Whoops\\": "src/Whoops/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Filipe Dobreira", + "homepage": "https://github.com/filp", + "role": "Developer" + } + ], + "description": "php error handling for cool kids", + "homepage": "https://filp.github.io/whoops/", + "keywords": [ + "error", + "exception", + "handling", + "library", + "throwable", + "whoops" + ], + "time": "2019-08-07T09:00:00+00:00" + }, + { + "name": "fzaninotto/faker", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/fzaninotto/Faker.git", + "reference": "27a216cbe72327b2d6369fab721a5843be71e57d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/27a216cbe72327b2d6369fab721a5843be71e57d", + "reference": "27a216cbe72327b2d6369fab721a5843be71e57d", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "ext-intl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7", + "squizlabs/php_codesniffer": "^2.9.2" + }, + "type": "library", + "extra": { + "branch-alias": [] + }, + "autoload": { + "psr-4": { + "Faker\\": "src/Faker/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Zaninotto" + } + ], + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "time": "2019-11-14T13:13:06+00:00" + }, { "name": "illuminate/auth", "version": "v6.5.1", @@ -1120,6 +1275,63 @@ "homepage": "https://laravel.com", "time": "2019-11-05T13:23:58+00:00" }, + { + "name": "illuminate/routing", + "version": "v6.5.2", + "source": { + "type": "git", + "url": "https://github.com/illuminate/routing.git", + "reference": "cd9131de6b3d756f6ef3303c749cb571324a7553" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/routing/zipball/cd9131de6b3d756f6ef3303c749cb571324a7553", + "reference": "cd9131de6b3d756f6ef3303c749cb571324a7553", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/container": "^6.0", + "illuminate/contracts": "^6.0", + "illuminate/http": "^6.0", + "illuminate/pipeline": "^6.0", + "illuminate/session": "^6.0", + "illuminate/support": "^6.0", + "php": "^7.2", + "symfony/debug": "^4.3.4", + "symfony/http-foundation": "^4.3.4", + "symfony/http-kernel": "^4.3.4", + "symfony/routing": "^4.3.4" + }, + "suggest": { + "illuminate/console": "Required to use the make commands (^6.0).", + "symfony/psr-http-message-bridge": "Required to psr7 bridging features (^1.2)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.0-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Routing\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Routing package.", + "homepage": "https://laravel.com", + "time": "2019-10-28T12:54:01+00:00" + }, { "name": "illuminate/session", "version": "v6.5.1", @@ -1379,6 +1591,94 @@ "homepage": "https://laravel.com", "time": "2019-11-08T13:18:30+00:00" }, + { + "name": "jakub-onderka/php-console-color", + "version": "v0.2", + "source": { + "type": "git", + "url": "https://github.com/JakubOnderka/PHP-Console-Color.git", + "reference": "d5deaecff52a0d61ccb613bb3804088da0307191" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/d5deaecff52a0d61ccb613bb3804088da0307191", + "reference": "d5deaecff52a0d61ccb613bb3804088da0307191", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "jakub-onderka/php-code-style": "1.0", + "jakub-onderka/php-parallel-lint": "1.0", + "jakub-onderka/php-var-dump-check": "0.*", + "phpunit/phpunit": "~4.3", + "squizlabs/php_codesniffer": "1.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "JakubOnderka\\PhpConsoleColor\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "jakub.onderka@gmail.com" + } + ], + "time": "2018-09-29T17:23:10+00:00" + }, + { + "name": "jakub-onderka/php-console-highlighter", + "version": "v0.4", + "source": { + "type": "git", + "url": "https://github.com/JakubOnderka/PHP-Console-Highlighter.git", + "reference": "9f7a229a69d52506914b4bc61bfdb199d90c5547" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/9f7a229a69d52506914b4bc61bfdb199d90c5547", + "reference": "9f7a229a69d52506914b4bc61bfdb199d90c5547", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "jakub-onderka/php-console-color": "~0.2", + "php": ">=5.4.0" + }, + "require-dev": { + "jakub-onderka/php-code-style": "~1.0", + "jakub-onderka/php-parallel-lint": "~1.0", + "jakub-onderka/php-var-dump-check": "~0.1", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~1.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "JakubOnderka\\PhpConsoleHighlighter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "acci@acci.cz", + "homepage": "http://www.acci.cz/" + } + ], + "description": "Highlight PHP code in terminal", + "time": "2018-09-29T18:48:56+00:00" + }, { "name": "laravel/lumen-framework", "version": "v6.2.0", @@ -1463,6 +1763,171 @@ ], "time": "2019-10-15T18:30:14+00:00" }, + { + "name": "league/flysystem", + "version": "1.0.57", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", + "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": ">=5.5.9" + }, + "conflict": { + "league/flysystem-sftp": "<1.0.6" + }, + "require-dev": { + "phpspec/phpspec": "^3.4", + "phpunit/phpunit": "^5.7.10" + }, + "suggest": { + "ext-fileinfo": "Required for MimeType", + "ext-ftp": "Allows you to use FTP server storage", + "ext-openssl": "Allows you to use FTPS server storage", + "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", + "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", + "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", + "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", + "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", + "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", + "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", + "league/flysystem-webdav": "Allows you to use WebDAV storage", + "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", + "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", + "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frenky.net" + } + ], + "description": "Filesystem abstraction: Many filesystems, one API.", + "keywords": [ + "Cloud Files", + "WebDAV", + "abstraction", + "aws", + "cloud", + "copy.com", + "dropbox", + "file systems", + "files", + "filesystem", + "filesystems", + "ftp", + "rackspace", + "remote", + "s3", + "sftp", + "storage" + ], + "time": "2019-10-16T21:01:05+00:00" + }, + { + "name": "mnapoli/front-yaml", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/mnapoli/FrontYAML.git", + "reference": "24070ace8b741247bb3161cbb38ecc541268b296" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mnapoli/FrontYAML/zipball/24070ace8b741247bb3161cbb38ecc541268b296", + "reference": "24070ace8b741247bb3161cbb38ecc541268b296", + "shasum": "" + }, + "require": { + "erusev/parsedown": "~1.0", + "php": ">=5.4.0", + "symfony/yaml": "~2.1|^3.0|^4.0" + }, + "require-dev": { + "league/commonmark": "~0.7", + "phpunit/phpunit": "~4.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Mni\\FrontYAML\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "time": "2017-10-29T19:29:55+00:00" + }, + { + "name": "mnapoli/silly", + "version": "1.7.1", + "source": { + "type": "git", + "url": "https://github.com/mnapoli/silly.git", + "reference": "5f7f34f4db75685e6fe7d652c12d9a7b6e8034d6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mnapoli/silly/zipball/5f7f34f4db75685e6fe7d652c12d9a7b6e8034d6", + "reference": "5f7f34f4db75685e6fe7d652c12d9a7b6e8034d6", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "php-di/invoker": "~2.0", + "psr/container": "^1.0", + "symfony/console": "~3.0|~4.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.12", + "mnapoli/phpunit-easymock": "~1.0", + "phpunit/phpunit": "~6.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Silly\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Silly CLI micro-framework based on Symfony Console", + "keywords": [ + "PSR-11", + "cli", + "console", + "framework", + "micro-framework", + "silly" + ], + "time": "2018-12-26T21:17:30+00:00" + }, { "name": "monolog/monolog", "version": "2.0.1", @@ -1544,6 +2009,176 @@ ], "time": "2019-11-13T10:27:43+00:00" }, + { + "name": "mpociot/documentarian", + "version": "0.3.0", + "source": { + "type": "git", + "url": "https://github.com/mpociot/documentarian.git", + "reference": "6a9f227ec1d1d295d4d3ee91bca0a6a98585684f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mpociot/documentarian/zipball/6a9f227ec1d1d295d4d3ee91bca0a6a98585684f", + "reference": "6a9f227ec1d1d295d4d3ee91bca0a6a98585684f", + "shasum": "" + }, + "require": { + "illuminate/view": "5.*|^6.0", + "mnapoli/front-yaml": "^1.5", + "mnapoli/silly": "~1.0", + "php": ">=5.5.9", + "windwalker/renderer": "3.*" + }, + "require-dev": { + "phpunit/phpunit": "^4.8" + }, + "bin": [ + "documentarian" + ], + "type": "library", + "autoload": { + "files": [ + "includes/helpers.php" + ], + "psr-4": { + "Mpociot\\Documentarian\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache 2" + ], + "authors": [ + { + "name": "Marcel Pociot", + "email": "m.pociot@gmail.com" + } + ], + "time": "2019-09-04T22:15:39+00:00" + }, + { + "name": "mpociot/laravel-apidoc-generator", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/mpociot/laravel-apidoc-generator.git", + "reference": "54e54ecaf80b38596d2b75bf3b988bb4cbc23c23" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mpociot/laravel-apidoc-generator/zipball/54e54ecaf80b38596d2b75bf3b988bb4cbc23c23", + "reference": "54e54ecaf80b38596d2b75bf3b988bb4cbc23c23", + "shasum": "" + }, + "require": { + "fzaninotto/faker": "^1.8", + "illuminate/console": "^5.7|^6.0", + "illuminate/routing": "^5.7|^6.0", + "illuminate/support": "^5.7|^6.0", + "league/flysystem": "^1.0", + "mpociot/documentarian": "^0.3.0", + "mpociot/reflection-docblock": "^1.0.1", + "nunomaduro/collision": "^3.0", + "php": ">=7.2.0", + "ramsey/uuid": "^3.8", + "symfony/var-exporter": "^4.0" + }, + "require-dev": { + "dingo/api": "^2.3.0", + "league/fractal": "^0.17.0", + "mockery/mockery": "^1.2.0", + "orchestra/testbench": "^3.7.0 || ^4.0", + "phpstan/phpstan": "^0.11.15", + "phpunit/phpunit": "^7.5.0" + }, + "suggest": { + "league/fractal": "Required for transformers support" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Mpociot\\ApiDoc\\ApiDocGeneratorServiceProvider" + ] + }, + "branch-alias": { + "dev-v4": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Mpociot\\ApiDoc\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marcel Pociot", + "email": "m.pociot@gmail.com" + } + ], + "description": "Generate beautiful API documentation from your Laravel application", + "homepage": "http://github.com/mpociot/laravel-apidoc-generator", + "keywords": [ + "api", + "documentation", + "laravel" + ], + "time": "2019-11-18T13:16:27+00:00" + }, + { + "name": "mpociot/reflection-docblock", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/mpociot/reflection-docblock.git", + "reference": "c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mpociot/reflection-docblock/zipball/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587", + "reference": "c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Mpociot": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2016-06-20T20:53:12+00:00" + }, { "name": "nesbot/carbon", "version": "2.26.0", @@ -1657,6 +2292,70 @@ ], "time": "2018-02-13T20:26:39+00:00" }, + { + "name": "nunomaduro/collision", + "version": "v3.0.1", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/collision.git", + "reference": "af42d339fe2742295a54f6fdd42aaa6f8c4aca68" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/af42d339fe2742295a54f6fdd42aaa6f8c4aca68", + "reference": "af42d339fe2742295a54f6fdd42aaa6f8c4aca68", + "shasum": "" + }, + "require": { + "filp/whoops": "^2.1.4", + "jakub-onderka/php-console-highlighter": "0.3.*|0.4.*", + "php": "^7.1", + "symfony/console": "~2.8|~3.3|~4.0" + }, + "require-dev": { + "laravel/framework": "5.8.*", + "nunomaduro/larastan": "^0.3.0", + "phpstan/phpstan": "^0.11", + "phpunit/phpunit": "~8.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "NunoMaduro\\Collision\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Cli error handling for console/command-line PHP applications.", + "keywords": [ + "artisan", + "cli", + "command-line", + "console", + "error", + "handling", + "laravel", + "laravel-zero", + "php", + "symfony" + ], + "time": "2019-03-07T21:35:13+00:00" + }, { "name": "opis/closure", "version": "3.4.1", @@ -1718,6 +2417,94 @@ ], "time": "2019-10-19T18:38:51+00:00" }, + { + "name": "paragonie/random_compat", + "version": "v9.99.99", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "shasum": "" + }, + "require": { + "php": "^7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "time": "2018-07-02T15:55:56+00:00" + }, + { + "name": "php-di/invoker", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/PHP-DI/Invoker.git", + "reference": "540c27c86f663e20fe39a24cd72fa76cdb21d41a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-DI/Invoker/zipball/540c27c86f663e20fe39a24cd72fa76cdb21d41a", + "reference": "540c27c86f663e20fe39a24cd72fa76cdb21d41a", + "shasum": "" + }, + "require": { + "psr/container": "~1.0" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "phpunit/phpunit": "~4.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Invoker\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Generic and extensible callable invoker", + "homepage": "https://github.com/PHP-DI/Invoker", + "keywords": [ + "callable", + "dependency", + "dependency-injection", + "injection", + "invoke", + "invoker" + ], + "time": "2017-03-20T19:28:22+00:00" + }, { "name": "phpoption/phpoption", "version": "1.5.2", @@ -1912,6 +2699,88 @@ ], "time": "2017-10-23T01:57:42+00:00" }, + { + "name": "ramsey/uuid", + "version": "3.8.0", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/d09ea80159c1929d75b3f9c60504d613aeb4a1e3", + "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "^1.0|^2.0|9.99.99", + "php": "^5.4 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "codeception/aspect-mock": "^1.0 | ~2.0.0", + "doctrine/annotations": "~1.2.0", + "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ~2.1.0", + "ircmaxell/random-lib": "^1.1", + "jakub-onderka/php-parallel-lint": "^0.9.0", + "mockery/mockery": "^0.9.9", + "moontoast/math": "^1.1", + "php-mock/php-mock-phpunit": "^0.3|^1.1", + "phpunit/phpunit": "^4.7|^5.0|^6.5", + "squizlabs/php_codesniffer": "^2.3" + }, + "suggest": { + "ext-ctype": "Provides support for PHP Ctype functions", + "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator", + "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator", + "ircmaxell/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "moontoast/math": "Provides support for converting UUID to 128-bit integer (in string form).", + "ramsey/uuid-console": "A console application for generating UUIDs with ramsey/uuid", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marijn Huizendveld", + "email": "marijn.huizendveld@gmail.com" + }, + { + "name": "Thibaud Fabre", + "email": "thibaud@aztech.io" + }, + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).", + "homepage": "https://github.com/ramsey/uuid", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "time": "2018-07-19T23:38:55+00:00" + }, { "name": "symfony/console", "version": "v4.3.8", @@ -2767,6 +3636,82 @@ "homepage": "https://symfony.com", "time": "2019-10-28T17:07:32+00:00" }, + { + "name": "symfony/routing", + "version": "v4.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/routing.git", + "reference": "cf6d72cf0348775f5243b8389169a7096221ea40" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/routing/zipball/cf6d72cf0348775f5243b8389169a7096221ea40", + "reference": "cf6d72cf0348775f5243b8389169a7096221ea40", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "conflict": { + "symfony/config": "<4.2", + "symfony/dependency-injection": "<3.4", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.2", + "psr/log": "~1.0", + "symfony/config": "^4.2|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/http-foundation": "^3.4|^4.0|^5.0", + "symfony/yaml": "^3.4|^4.0|^5.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation loader", + "symfony/config": "For using the all-in-one router or any loader", + "symfony/expression-language": "For using expression matching", + "symfony/http-foundation": "For using a Symfony Request object", + "symfony/yaml": "For using the YAML loader" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Routing\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Routing Component", + "homepage": "https://symfony.com", + "keywords": [ + "router", + "routing", + "uri", + "url" + ], + "time": "2019-11-20T13:44:34+00:00" + }, { "name": "symfony/service-contracts", "version": "v1.1.8", @@ -3034,6 +3979,125 @@ ], "time": "2019-10-13T12:02:04+00:00" }, + { + "name": "symfony/var-exporter", + "version": "v4.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-exporter.git", + "reference": "72feb69a33def8f761e612360588e40bac98caad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/72feb69a33def8f761e612360588e40bac98caad", + "reference": "72feb69a33def8f761e612360588e40bac98caad", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "require-dev": { + "symfony/var-dumper": "^4.1.1|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\VarExporter\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A blend of var_export() + serialize() to turn any serializable data structure to plain PHP code", + "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "serialize" + ], + "time": "2019-11-13T07:39:40+00:00" + }, + { + "name": "symfony/yaml", + "version": "v4.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "76de473358fe802578a415d5bb43c296cf09d211" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/76de473358fe802578a415d5bb43c296cf09d211", + "reference": "76de473358fe802578a415d5bb43c296cf09d211", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "^3.4|^4.0|^5.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2019-11-12T14:51:11+00:00" + }, { "name": "vlucas/phpdotenv", "version": "v3.6.0", @@ -3090,6 +4154,116 @@ "environment" ], "time": "2019-09-10T21:37:39+00:00" + }, + { + "name": "windwalker/renderer", + "version": "3.5.15", + "source": { + "type": "git", + "url": "https://github.com/ventoviro/windwalker-renderer.git", + "reference": "b157f2832dac02209db032cb61e21b8264ee4499" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ventoviro/windwalker-renderer/zipball/b157f2832dac02209db032cb61e21b8264ee4499", + "reference": "b157f2832dac02209db032cb61e21b8264ee4499", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "windwalker/structure": "~3.0" + }, + "require-dev": { + "illuminate/view": "5.2.*", + "league/plates": "3.*", + "mustache/mustache": "2.*", + "twig/twig": "1.*", + "windwalker/dom": "~3.0", + "windwalker/filesystem": "~3.0", + "windwalker/test": "~3.0" + }, + "suggest": { + "illuminate/view": "Install 5.* if you require Laravel Blade engine.", + "league/plates": "Install 3.* if you require Plates template engine.", + "mustache/mustache": "Install 2.* if you require Mustache engine.", + "twig/twig": "Install 1.* if you require Twig engine." + }, + "type": "windwalker-package", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Windwalker\\Renderer\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.0-or-later" + ], + "description": "Windwalker Renderer package", + "homepage": "https://github.com/ventoviro/windwalker-renderer", + "keywords": [ + "framework", + "renderer", + "windwalker" + ], + "time": "2019-10-26T15:42:26+00:00" + }, + { + "name": "windwalker/structure", + "version": "3.5.15", + "source": { + "type": "git", + "url": "https://github.com/ventoviro/windwalker-structure.git", + "reference": "4e0ea9cf1b73ad6c6651fc4f3ed86ade90eea04d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ventoviro/windwalker-structure/zipball/4e0ea9cf1b73ad6c6651fc4f3ed86ade90eea04d", + "reference": "4e0ea9cf1b73ad6c6651fc4f3ed86ade90eea04d", + "shasum": "" + }, + "require": { + "php": ">=7.1.3" + }, + "require-dev": { + "ext-json": "*", + "laktak/hjson": "^2.1", + "symfony/yaml": "3.*", + "windwalker/test": "~3.0", + "yosymfony/toml": "^1.0" + }, + "suggest": { + "laktak/hjson": "Install ~2.0 if you require HJSON support.", + "symfony/yaml": "Install 3.* if you require YAML support.", + "yosymfony/toml": "Install ~1.0 if you require TOML support." + }, + "type": "windwalker-package", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Windwalker\\Structure\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.0-or-later" + ], + "description": "Windwalker Structure package", + "homepage": "https://github.com/ventoviro/windwalker-structure", + "keywords": [ + "framework", + "structure", + "windwalker" + ], + "time": "2019-10-27T07:38:41+00:00" } ], "packages-dev": [ @@ -3149,54 +4323,6 @@ ], "time": "2019-10-21T16:45:58+00:00" }, - { - "name": "fzaninotto/faker", - "version": "v1.9.0", - "source": { - "type": "git", - "url": "https://github.com/fzaninotto/Faker.git", - "reference": "27a216cbe72327b2d6369fab721a5843be71e57d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/27a216cbe72327b2d6369fab721a5843be71e57d", - "reference": "27a216cbe72327b2d6369fab721a5843be71e57d", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "ext-intl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7", - "squizlabs/php_codesniffer": "^2.9.2" - }, - "type": "library", - "extra": { - "branch-alias": [] - }, - "autoload": { - "psr-4": { - "Faker\\": "src/Faker/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "François Zaninotto" - } - ], - "description": "Faker is a PHP library that generates fake data for you.", - "keywords": [ - "data", - "faker", - "fixtures" - ], - "time": "2019-11-14T13:13:06+00:00" - }, { "name": "hamcrest/hamcrest-php", "version": "v2.0.0", diff --git a/config/apidoc.php b/config/apidoc.php new file mode 100644 index 0000000..cb46b7f --- /dev/null +++ b/config/apidoc.php @@ -0,0 +1,245 @@ + 'static', + + /* + * The router to be used (Laravel or Dingo). + */ + 'router' => 'laravel', + + /* + * The base URL to be used in examples and the Postman collection. + * By default, this will be the value of config('app.url'). + */ + 'base_url' => null, + + /* + * Generate a Postman collection in addition to HTML docs. + * For 'static' docs, the collection will be generated to public/docs/collection.json. + * For 'laravel' docs, it will be generated to storage/app/apidoc/collection.json. + * The `ApiDoc::routes()` helper will add routes for both the HTML and the Postman collection. + */ + 'postman' => [ + /* + * Specify whether the Postman collection should be generated. + */ + 'enabled' => true, + + /* + * The name for the exported Postman collection. Default: config('app.name')." API" + */ + 'name' => null, + + /* + * The description for the exported Postman collection. + */ + 'description' => null, + ], + + /* + * The routes for which documentation should be generated. + * Each group contains rules defining which routes should be included ('match', 'include' and 'exclude' sections) + * and rules which should be applied to them ('apply' section). + */ + 'routes' => [ + [ + /* + * Specify conditions to determine what routes will be parsed in this group. + * A route must fulfill ALL conditions to pass. + */ + 'match' => [ + + /* + * Match only routes whose domains match this pattern (use * as a wildcard to match any characters). + */ + 'domains' => [ + '*', + // 'domain1.*', + ], + + /* + * Match only routes whose paths match this pattern (use * as a wildcard to match any characters). + */ + 'prefixes' => [ + '*', + // 'users/*', + ], + + /* + * Match only routes registered under this version. This option is ignored for Laravel router. + * Note that wildcards are not supported. + */ + 'versions' => [ + 'v1', + ], + ], + + /* + * Include these routes when generating documentation, + * even if they did not match the rules above. + * Note that the route must be referenced by name here (wildcards are supported). + */ + 'include' => [ + // 'users.index', 'healthcheck*' + ], + + /* + * Exclude these routes when generating documentation, + * even if they matched the rules above. + * Note that the route must be referenced by name here (wildcards are supported). + */ + 'exclude' => [ + // 'users.create', 'admin.*' + ], + + /* + * Specify rules to be applied to all the routes in this group when generating documentation + */ + 'apply' => [ + /* + * Specify headers to be added to the example requests + */ + 'headers' => [ + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + // 'Authorization' => 'Bearer {token}', + // 'Api-Version' => 'v2', + ], + + /* + * If no @response or @transformer declarations are found for the route, + * we'll try to get a sample response by attempting an API call. + * Configure the settings for the API call here. + */ + 'response_calls' => [ + /* + * API calls will be made only for routes in this group matching these HTTP methods (GET, POST, etc). + * List the methods here or use '*' to mean all methods. Leave empty to disable API calls. + */ + 'methods' => ['GET'], + + /* + * Laravel config variables which should be set for the API call. + * This is a good place to ensure that notifications, emails + * and other external services are not triggered + * during the documentation API calls + */ + 'config' => [ + 'app.env' => 'documentation', + 'app.debug' => false, + // 'service.key' => 'value', + ], + + /* + * Cookies which should be sent with the API call. + */ + 'cookies' => [ + // 'name' => 'value' + ], + + /* + * Query parameters which should be sent with the API call. + */ + 'queryParams' => [ + // 'key' => 'value', + ], + + /* + * Body parameters which should be sent with the API call. + */ + 'bodyParams' => [ + // 'key' => 'value', + ], + ], + ], + ], + ], + + 'strategies' => [ + 'metadata' => [ + \Mpociot\ApiDoc\Extracting\Strategies\Metadata\GetFromDocBlocks::class, + ], + 'urlParameters' => [ + \Mpociot\ApiDoc\Extracting\Strategies\UrlParameters\GetFromUrlParamTag::class, + ], + 'queryParameters' => [ + \Mpociot\ApiDoc\Extracting\Strategies\QueryParameters\GetFromQueryParamTag::class, + ], + 'headers' => [ + \Mpociot\ApiDoc\Extracting\Strategies\RequestHeaders\GetFromRouteRules::class, + ], + 'bodyParameters' => [ + \Mpociot\ApiDoc\Extracting\Strategies\BodyParameters\GetFromBodyParamTag::class, + ], + 'responses' => [ + \Mpociot\ApiDoc\Extracting\Strategies\Responses\UseTransformerTags::class, + \Mpociot\ApiDoc\Extracting\Strategies\Responses\UseResponseTag::class, + \Mpociot\ApiDoc\Extracting\Strategies\Responses\UseResponseFileTag::class, + \Mpociot\ApiDoc\Extracting\Strategies\Responses\UseApiResourceTags::class, + \Mpociot\ApiDoc\Extracting\Strategies\Responses\ResponseCalls::class, + ], + ], + + /* + * Custom logo path. The logo will be copied from this location + * during the generate process. Set this to false to use the default logo. + * + * Change to an absolute path to use your custom logo. For example: + * 'logo' => resource_path('views') . '/api/logo.png' + * + * If you want to use this, please be aware of the following rules: + * - the image size must be 230 x 52 + */ + 'logo' => false, + + /* + * Name for the group of routes which do not have a @group set. + */ + 'default_group' => 'general', + + /* + * Example requests for each endpoint will be shown in each of these languages. + * Supported options are: bash, javascript, php, python + * You can add a language of your own, but you must publish the package's views + * and define a corresponding view for it in the partials/example-requests directory. + * See https://laravel-apidoc-generator.readthedocs.io/en/latest/generating-documentation.html + * + */ + 'example_languages' => [ + 'bash', + 'javascript', + ], + + /* + * Configure how responses are transformed using @transformer and @transformerCollection + * Requires league/fractal package: composer require league/fractal + * + */ + 'fractal' => [ + /* If you are using a custom serializer with league/fractal, + * you can specify it here. + * + * Serializers included with league/fractal: + * - \League\Fractal\Serializer\ArraySerializer::class + * - \League\Fractal\Serializer\DataArraySerializer::class + * - \League\Fractal\Serializer\JsonApiSerializer::class + * + * Leave as null to use no serializer or return a simple JSON. + */ + 'serializer' => null, + ], + + /* + * If you would like the package to generate the same example values for parameters on each run, + * set this to any number (eg. 1234) + * + */ + 'faker_seed' => null, +];