Download the PHP package futurfuturfuturfutur/duckduckduck without Composer
On this page you can find all versions of the php package futurfuturfuturfutur/duckduckduck. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download futurfuturfuturfutur/duckduckduck
More information about futurfuturfuturfutur/duckduckduck
Files in futurfuturfuturfutur/duckduckduck
Package duckduckduck
Short Description Laravel package able to auto generate API documentation through tests, without garbage comments inside the code base.
License MIT
Informations about the package duckduckduck
🦆 DuckDuckDuck
Laravel package able to auto generate API documentation through tests, without garbage comments inside the code base.
Support of documentations
- OpenAPI 3.0.0
How it works
If your project has excellent feature testing coverage, it means you already has documentation for this project. You've already described available paths, requests body, parameters, content types, response payloads and http codes. You shouldn't describe it again by your own just in format of the api documentation you use.The package principle is super simple: when you run tests, package middleware just grab response and request of the test case and saves it as an api documentation config file, which you can use to render.
Install
- Install package with
composer require --dev futurfuturfuturfutur/duckduckduck
- Publish and setup package with
php artisan duckduckduck:init
. This command will publish duckduckduck.php configuration file inside the folder of Laravel with base configuration of your API documentation and create
package dir inside the root of the app to contain all documentation configs of your project generated by package. - Add TestCase trait inside the phpunit TestCase
Usage
Setup
The package will handle most of the things, but some of them you need to define by yourself:
- Define base info of the API documentation (name, description, type of documentation, version) inside the
config/duckduckduck.php
-
Route description and group should be defined as PHPDoc comment of the class of the test (All of them are optional):
- A test case description should be defined as PHPDoc comment of the case method:
Run build
Run your tests in API documentation generation mode with php artisan duckduckduck:generate
. The package will run feature tests pf your app
and generate documentation file inside the package dir inside the root of the app.
Run documentation render with Docker
The easiest and prettiest way to run your documentation render server to just up the docker container with
package directory passed inside.
Swagger
Remember that mounting duckduckduck folder should be defined as absolute path
API documentation
- [x] Base info about documentation
- [x] Grouped paths with descriptions and methods
- [x] Path, query and body parameters from request
- [x] Responses for the route with payloads and codes
- [x] Info about the server is running the API
- [ ] Parameters validation rules from form request
Contributing
Please see Contribution for details.
License
The MIT License (MIT). Please see License File for more information.