Simple laravel api document generator
https://jheckdoc-laravel-demo.herokuapp.com/api/documentation
You can install the package via composer
composer require jheckdoc/jheckdoc-laravel
Generate json file
php artisan jheckdoc:generate
$ php artisan vendor:publish --tag=jheckdoc-config
Name | Type | Description |
---|---|---|
@jheckdocInfo |
String | TThis is required for details of api documentation. Sample header |
@jheckdoc |
String | This is required to add on top of each codeblocks. Sample annotation |
method |
String | Your desired route method, Sample GET , POST , PUT , DELETE , OPTIONS |
route |
String | Your api endpoint. Note: no need to put the full url |
name |
String | Enter desired name for your endpoint |
description |
String | Description of your endpoint |
headers |
Object | For custom headers |
params |
Object | Enter parameters for your endpoint |
responses |
Object | Server responses |
/*@jheckdocInfo
{
"version": "1.0.0",
"title":"Jheckdoc API",
"description" : "Sample description of api",
"contact" : "hello@jheckdoc.com",
"servers": [
{
"url" : "https://jheckdoc.com",
"description": "Production api server"
},
{
"url" : "https://dev.jheckdoc.com",
"description": "Development api server"
}
]
}
*/
Each code block requires a valid json format. Please see Sample annotations for more.
/*@jheckdoc
{
"method" : "POST",
"route" : "/v1/users/login",
"name":"User login",
"description": "Login to get authorization token.",
"group":"user",
"headers":{
"Content-Type": {
"required": true,
"value":"application/x-www-form-urlencoded"
}
},
"params" : {
"email" :{
"type":"string",
"description": "Enter E-mail address",
"required" : true
},
"password" :{
"type":"string",
"description": "Enter Password",
"required" : true
}
},
"responses": {
"200": {
"description": "Success"
},
"401": {
"description": "Unauthenticated"
}
}
}
*/
http://localhost:8000/api/documentation
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, pelase use issue tracker.
The MIT License (MIT). Please see License File for more information.
Copyright (c) 2020, Jeric
This package was generated using the Laravel Package Boilerplate.