Restler v3 の最新バージョン (commit 0d79cd8) を使用していますが、Swagger ベースの UI が例と同じに見えるという問題があります。私が気付いている 2 つの問題は、変数の入力と @return オブジェクトが表示されないことです。
Restler のサイトでは、これらの両方が機能している良い例を次に示します。
代わりに、Actionsクラスでこれを取得します。
それでも、クラスの定義からわかるように、型情報と応答オブジェクトの両方が指定されています。
class Actions {
/**
* LIST action types
*
* List all the action-types available
*
* @url GET /
*/
function list_actions() {
throw new RestException(501);
}
/**
* GET today's Actions
*
* Get the set of actions done today
*
* @url GET /{user_id}
* @param integer $user_id The user_id for whom the actions apply; you can insert the text "self" and it will resolve to the current/default user
* @param string $time_of_day {@from url} Allow's you to optionally set a time-of-day; if set then actions are only returned after that. Time should be in the format of HH:MM:SS
* @return ActionList
*/
public function action_today ($user_id, $time_of_day = false )
{
throw new RestException(501, "Today's actions for user '{$user_id}' not implemented.");
}
私の ActionList クラスの定義は次のとおりです。
class ActionList {
/**
* Unique identifier of action
*
* @var integer
*/
public $action_id;
/**
* String based unique identifier
*
* @var string
*/
public $action_slug;
}