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": ""
}
}
預先感謝您
我什麼都看不到輸出。你的json世代輸出在哪裏發生? –
@GeraldSchneider他正在討論由Resources類生成的默認值,並由Restler API Explorer針對上述api類顯示 – Luracast