php - Restler: Complex Object Types as Parameters -
hello restler friends,
i'm trying switch restler our main rest-framework. motivated decision swagger compliance. find quite important have nice autogenerated documentation ongrowing system.
so, problem can't seem find way use "complex objects" post parameters specified in swagger here : https://github.com/wordnik/swagger-core/wiki/parameters.
sure retrieve "post assoc array" , validate against objects structures, not documented , client not know structures expected him. consequently have write spec. hand...
example :
/** * create new account, based on structure of account object * * @param account $account {@from body} * * @return string * */ protected function post(account $account){...}
this put undefined "object" in resource.json , not "complex type" linked account object (this working returned objects way)
resource.json
"parameters": [ { "name": "request_body", "description": "paste json data here following property.<hr/><mark>account</mark> <i>(required)</i>: add <mark>@param {type} $account {comment}</mark> describe here", "paramtype": "body", "required": true, "allowmultiple": false, "datatype": "object", "defaultvalue": "{\n \"account\": \"\"\n}" } ],
did miss or feature not implemented?
thanks in advance helping me out!
update : managed serialized objects directly out of post method nativly, though not possible. doesn't solve auto-doc problem still valuable.
restler 3 rc4 released yesterday custom class parameters feature
read http://restler3.luracast.com/param.html#type example , testing code
Comments
Post a Comment