2017 © Pedro Peláez
 

library apidoc

A sample way to scan Swagger annotation documents

image

davin.bao/apidoc

A sample way to scan Swagger annotation documents

  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Build Status Total Downloads License, (*1)

apidoc

A sample way to generate Swagger documentation for your RESTful API using doctrine annotations., (*2)

Features

  • Compatible with the Swagger 2.0 specification
  • Support multi-apps

Installation (with Composer)

  1. Clone the code
  2. Install vendors
composer install
  1. Configure the host like this
vi /etc/hosts
# add IP VHOST
127.0.0.1 apidoc.local
  1. Configure the virtual host for Apache
<VirtualHost *:80>
 ServerName apidoc.local
    DocumentRoot "/www/apidoc/public"

    <Directory "/www/apidoc/public">
        # use mod_rewrite for pretty URL support
        RewriteEngine on
        # If a directory or a file exists, use the request directly
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        # Otherwise forward the request to index.php
        RewriteRule . index.php

        # use index.php as index file
        DirectoryIndex index.html index.php
    </Directory>
</VirtualHost>

Usage

Add annotations to your php files., (*3)

/**
 * @SWG\Info(title="My First API", version="0.1")
 */

/**
 * @SWG\Get(
 *     path="/api/resource.json",
 *     @SWG\Response(response="200", description="An example resource")
 * )
 */

See the Examples directory for more., (*4)

Configure

  1. Open config/app.php
  2. To Config the "app-list"
  3. browse http://YOUR_HOST/APP_NAME, for example: http://apidoc.local/apiv1 http://apidoc.local/apiv2

More on Swagger

  • http://swagger.io/
  • https://github.com/swagger-api/swagger-spec/
  • http://bfanger.github.io/swagger-explained/

Contributing

Feel free to submit Github Issues or pull requests., (*5)

The Versions

16/03 2017

dev-master

9999999-dev

A sample way to scan Swagger annotation documents

  Sources   Download

Apache License

The Requires

 

by davin.bao

api documentation swagger