Created
October 6, 2015 00:59
-
-
Save manchan/e5ba1bd6b465d2d020d7 to your computer and use it in GitHub Desktop.
PHPでのAPIドキュメント作成ツール(RESTful APIとソースコードドキュメント生成) ref: http://qiita.com/you_matz/items/fa6f1691dcfec7aeac1b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#生成 | |
apidoc -i fuel/app -f ".*\\.php$" -o public/apidoc/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "example", | |
"version": "0.1.0", | |
"description": "apiDoc basic example", | |
"title": "Custom apiDoc browser title", | |
"url" : "https://api.github.com/v1" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @api {post} /user/:id ユーザー取得 | |
* @apiVersion 0.1.0 | |
* @apiName ユーザー取得 | |
* @apiGroup User | |
* | |
* @apiParam {Number} id ユーザーのユニークID. | |
* | |
* @apiSuccess {String} firstname 名前. | |
* @apiSuccess {String} lastname 苗字. | |
* | |
* @apiSuccessExample Success-Response: | |
* HTTP/1.1 200 OK | |
* { | |
* "firstname": "John", | |
* "lastname": "Doe" | |
* } | |
* | |
* @apiError UserNotFound ユーザーが見つからないとき. | |
* | |
* @apiErrorExample Error-Response: | |
* HTTP/1.1 404 Not Found | |
* { | |
* "error": "UserNotFound" | |
* } | |
*/ | |
function getUser(id) { | |
// dummy | |
return "ユーザー情報"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://apigen.org/apigen.phar | |
chmod +x apigen.phar | |
mv apigen.phar /usr/local/bin/apigen | |
apigen --version | |
# get help for generate command | |
apigen generate --help | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment