0

I am using the latest version of Restler v3 (commit 0d79cd8) but I'm having some problems having my Swagger-based UI look the same as in the examples. The two problems I'm noticing are that variable typing and @return objects are not being displayed.

On the Restler site, here's a good example of both of these working:

example

Instead, in my Actions class I get this:

enter image description here

And yet as you can see from definition of the class both type information and a response object is specified:

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.");
    }

and my definition of ActionList class is:

class ActionList {

    /**
     * Unique identifier of action
     *
     * @var     integer
    */
    public $action_id;
    /**
     * String based unique identifier
     *
     * @var     string
    */
    public $action_slug;

}
ken
  • 8,763
  • 11
  • 72
  • 133

1 Answers1

0

If your class is versioned, e.g. in the namespace v1\Actions, you have to annotate the return type in the namespace too, e.g. @return v1\ActionList

RoDent
  • 1