2
안녕하세요 Swagger/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 문서를 생성 할 : 나는 index.html을 실행할 때
class ComplexType {
/**
* post 2 Authors
*
* @param Author $author1
* @param Author $author2
*
* @return Author
*/
function post2Authors(Author $author1,Author $author2) {
return $author1;
}
}
그것은 나를 준다 입력에 다음
{
"author1": "",
"author2": ""
}
그러나 나는 다음과 같이 JSON 입력을 볼 필요가 :
{
"author1":
{
"name": "",
"email": ""
},
"author2": {
"name": "",
"email": ""
}
}
는
전혀 출력이 표시되지 않습니다. 귀하의 json 세대는 어디에서 결과를 출력합니까? –
@GeraldSchneider 그는 리소스 클래스에 의해 생성 된 기본값에 대해 이야기하고 있으며 위의 API 클래스에 Restler API Explorer가 표시했습니다. – Luracast