2013-11-20 23 views
2

嗨揚鞭/ Restler朋友PHP函數,簡單的測試對於採用多個對象作爲參數

我怎樣才能讓用戶能夠對PHP函數和類簡單的測試?

我有一個類如下:

class Author 

{ 
    /** 
    * @var string {@from body} {@min 3}{@max 100} 
    * name of the Author {@required true} 
    */ 
    public $name = 'Name'; 
    /** 
    * @var string {@type email} {@from body} 
    * email id of the Author 
    */ 
    public $email = '[email protected]'; 
} 

,我想生成的HTML文檔,一類是作爲後續:

class ComplexType { 

/** 
* post 2 Authors 
* 
* @param Author $author1 
* @param Author $author2 
* 
* @return Author 
*/ 
function post2Authors(Author $author1,Author $author2) { 
    return $author1; 
} 
} 

它給了我,當我運行的index.html以下輸入:

{ 
    "author1": "", 
    "author2": "" 
} 

但我需要查看JSON輸入如下:

{ 
    "author1": 
     { 
      "name": "", 
      "email": "" 
     }, 
    "author2": { 
      "name": "", 
      "email": "" 
    } 
} 

預先感謝您

+2

我什麼都看不到輸出。你的json世代輸出在哪裏發生? –

+0

@GeraldSchneider他正在討論由Resources類生成的默認值,並由Restler API Explorer針對上述api類顯示 – Luracast

回答

0

默認值作爲一個簡單的啓動器試圖與Restler API瀏覽器的API。

目前,當發現一個以上的身體參數,因此我們堅持

{ 
    "author1": "", 
    "author2": "" 
} 

我們正在支持工作揚鞭1.2規範,以及我們將發佈完整的它並沒有提供模式解析模型解析的默認值,很快