I'm using Swagger PHP and most of the definitions are easy to define, but I'm having an issue with a particular piece of data that is not part of a seperate class, but instead an associative array.
The json response I wish to show (simplified for this question):
{
"id": 1,
"status": "published",
"gps": {
"lat": "0.00000000",
"lng": "0.00000000"
}
The id
and status
are easy enough to define, however the gps
is a problem as there is no seperate class to define it in, it is an array inside the model. Is it possible to define this array without having to create a dummy class?
The comments in the model file currently:
/**
* @SWG\Definition(@SWG\Xml(name="Event"))
*/
class Event extends BaseModel {
/**
* @SWG\Property(
* property="id",
* type="integer",
* example="103"
* )
* @SWG\Property(
* property="status",
* type="string",
* enum={"published", "draft", "suspended"}
* example="published"
* )
*/
}