Download the PHP package widmogrod/zf2-rest-api-documentator without Composer
On this page you can find all versions of the php package widmogrod/zf2-rest-api-documentator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download widmogrod/zf2-rest-api-documentator
More information about widmogrod/zf2-rest-api-documentator
Files in widmogrod/zf2-rest-api-documentator
Package zf2-rest-api-documentator
Short Description Module generating REST API documentation
License MIT
Informations about the package zf2-rest-api-documentator
Module generating REST API documentation v1.6.1
Introduction
This module allow to create quick documentation of your REST API.
Main features that I want to implement:
- Generate REST API documentation.
[√]
Describe function of available parameters[√]
Create a general description of the parameters several times repeated
- Unlimited number of documented APIs
[√]
Create modules for ZF2 containing a good and standardized documentation
- Elastic & simple to use.
[√]
Use predefined interpreter for configuration or write it by your self[-]
Do you have a self-describing API and you want to automaticly build documentation from it? Help me, to write that kind of interpreter or wait until I'll do it
- Well documented
[√]
The module is shipped with API documentation, documented by this module.[√]
Some issues are described in tips & trick section
- Posibility to test & play with API from docs page
[√]
Execute API call from documentation[-]
Performing authorization (OAuth, BaseAuth, ...)
Read TODO.md for more information.
Installation
cd my/project/directory
-
Create a
composer.json
file with following content: - Run
php composer.phar install
- Open
my/project/folder/configs/application.config.php
and:- add
'WidRestApiDocumentator'
to your'modules'
parameter. - add
'AsseticBundle'
to your'modules'
parameter (optional if you want to include CSS)
- add
Usage
Bellow is php configuration file that show haw to implement simple REST API documentation in your module. This is a minimal configuration required to achieve result shown further dawn.
Below is example showing how this configuration will look like.
To see this result, enter in browser your application addres and go to route /rest-api-docs
.
Tips & tricks
Setup you own route to your documentation.
Write your own strategy
Currently module have one strategy named "standard". Strategy is way, in which documentation configuration will be interpreted. It's very useful way to create your own interpreter. To do that you need to do two things
- Write your strategy implementing this interface
WidRestApiDocumentator\StrategyInterface
- Tell the module, that there is new strategy. Create this configuration entry:
How to run this module without installing ZendSkeletonApplication
- Clone this module
[email protected]:widmogrod/zf2-rest-api-documentator.git
- Go to module directory
- run
composer.phar install --dev
-
create file
index.php
in module directory with content: - Run web server in this directory f.e.
php -S 127.0.0.1:8080