2017-02-09 79 views
9

在我Restler API類我已經定義了以下這樣一個對象(與許多其他則params的)Restler不接受布爾值false

class PatchTaskObj extends TaskObj { 
    /** 
    * @var bool|null Whether or not this Task should be pinned to the top of the list {@required false} 
    */ 
    public $pinned = null; 
} 

然後我試圖在我的PATCH方法來使用它:

/** 
    * Updates an existing Task record. 
    * 
    * @param int   $id The SQL ident of the task you wish to update. {@min 1} {@from path} 
    * @param PatchTaskObj $info The properties of the Task to update. 
    * 
    * @throws RestException 412 Thrown if at least one update isn't passed in. 
    * 
    * @status 204 
    */ 
    function patch($id, PatchTaskObj $info) 

如果我在true通爲pinned財產它工作正常,但如果我通過false然後我從Restler 400與消息:

請求無效:爲info[pinned]

回答

3

OK指定的值無效,發現Restler的Validator.php未能解析@var屬性它的編寫方式。如果您刪除了|null部件,則按預期工作。我向github網站提交了一個問題。