How to describe response type
camlafit opened this issue · comments
Hello
Sorry to open about this but I've not found information code source and official documentation. How could we provide a response description more accurate ?
By default Explorer display a simple model schema
[ "string" ]
We can improve this result if we type phpdoc return
/**
* @return array {@type int}
* /
public function get($id) {}
if we set any other value than array
as int
or string
, model schema is removed
if we set some value in {@type }
it's broken also as Object
, array
How can provide a more accurate description about as we can get with {@params}
description ?
Thanks a lot
Note, following https://github.com/Luracast/Restler/blob/master/src/Explorer/v2/Explorer.php#L457, some {@type} could be provided. Following code, we could set
@return array Description {@type associative}
@return array Description {@type indexed}
@return array Description {@type AnyObject}
@return antype Description
With {@type indexed}
return it's forced to string
If array
is not set or different, in this case it's forced to string
Check this with the latest commits in the V5 branch. Hope its resolved
now available in 5.0.7
Hello
This use case broke again :
@return array qezaezaezaezza {@type array}
Thanks
That use case is not supported by swagger. You can do one of the following instead
@return array description {@type indexed}
indexed array@return array description {@type associative}
associative array / object@return object[] description
array of objects@return string[] description
array of strings