git clone https://github.com/pushrsp/wpi-doc
npm install
npm link
@wpiRoute api [method]
@wpiRoute api/test [post]
@wpiDescription description
@wpiDescription 테스트입니다.
@wpiBody {type} key explain
@wpiBody {string} username 아이디
@wpiSuccess {type} key explain
@wpiSuccess {int} statusCode 상태코드
@wpiFail {type} key explain
@wpiFail {string} error 에러 메세지
@wpiDefineKey key
@wpiDefineKey address
@wpiDefineValue {type} key explain
@wpiDefineValue {string} code 코드
@wpiParam {type} key explain
@wpiParam {string} id 유저 UID
@wpiQuery {type} key explain
@wpiQuery {string} size 페이지 사이즈
/**
* @wpiRoute api/test [post]
* @wpiDescription 테스트입니다.
* @wpiBody {string} username 아이디
* @wpiBody {string} password 비밀번호
* @wpiBody {string} nickname 닉네임
* @wpiSuccess {string} message 메세지
* @wpiSuccess {int} statusCode 상태코드
* @wpiSuccess {object} data 데이터
* @wpiFail {string} message 메세지
* @wpiFail {int} statusCode 상태코드
* @wpiFail {string} error 에러
*/
output:
[
{
"route": "api/test",
"method": "POST",
"description": "테스트입니다.",
"body": [
{
"key": "username",
"type": "string",
"explain": "아이디",
"collapse": {}
},
{
"key": "password",
"type": "string",
"explain": "비밀번호",
"collapse": {}
},
{
"key": "nickname",
"type": "string",
"explain": "닉네임",
"collapse": {}
}
],
"success": [
{
"type": "string",
"key": "message",
"explain": "메세지",
"collapse": {}
},
{
"type": "int",
"key": "statusCode",
"explain": "상태코드",
"collapse": {}
},
{
"type": "object",
"key": "data",
"explain": "데이터",
"collapse": {}
}
],
"fail": [
{
"type": "string",
"key": "message",
"explain": "메세지",
"collapse": {}
},
{
"type": "int",
"key": "statusCode",
"explain": "상태코드",
"collapse": {}
},
{
"type": "string",
"key": "error",
"explain": "에러",
"collapse": {}
}
]
}
]
/**
* @wpiDefineKey hi
* @wpiDefineValue {string} abc 하이
*/
/**
* @wpiRoute api/embed [post]
* @wpiDescription 임베딩 테스트입니다.
* @wpiBody {hi} hi 임베딩
*/
output:
[
{
"route": "api/embed",
"method": "POST",
"description": "임베딩 테스트입니다.",
"body": [
{
"key": "hi",
"type": "hi",
"explain": "임베딩",
"collapse": {
"hi": [
{
"key": "abc",
"type": "string",
"explain": "하이",
"collapse": {}
}
]
}
}
]
}
]
/**
* @wpiDefineKey bye
* @wpiDefineValue {string} ollah 바이
*/
/**
* @wpiDefineKey hi
* @wpiDefineValue {string} abc 하이
*/
/**
* @wpiRoute api/or [post]
* @wpiDescription 'or' 테스트입니다.
* @wpiBody {hi|bye} hi 임베딩
*/
output:
[
{
"route": "api/or",
"method": "POST",
"description": "'or' 테스트입니다.",
"body": [
{
"key": "hi",
"type": "hi|bye",
"explain": "임베딩",
"collapse": {
"hi": [
{
"key": "abc",
"type": "string",
"explain": "하이",
"collapse": {}
}
],
"bye": [
{
"key": "ollah",
"type": "string",
"explain": "바이",
"collapse": {}
}
]
}
}
]
}
]