Fix for Swagger docs

This commit is contained in:
Hillel Coren 2017-11-06 16:36:36 +02:00
parent e59665c88e
commit 3a0b246c09
2 changed files with 14 additions and 6 deletions

View File

@ -118,12 +118,12 @@ class ProjectApiController extends BaseAPIController
* @SWG\Parameter( * @SWG\Parameter(
* in="body", * in="body",
* name="body", * name="body",
* @SWG\Schema(ref="#/definitions/project") * @SWG\Schema(ref="#/definitions/Project")
* ), * ),
* @SWG\Response( * @SWG\Response(
* response=200, * response=200,
* description="New project", * description="New project",
* @SWG\Schema(type="object", @SWG\Items(ref="#/definitions/project")) * @SWG\Schema(type="object", @SWG\Items(ref="#/definitions/Project"))
* ), * ),
* @SWG\Response( * @SWG\Response(
* response="default", * response="default",
@ -155,12 +155,12 @@ class ProjectApiController extends BaseAPIController
* @SWG\Parameter( * @SWG\Parameter(
* in="body", * in="body",
* name="project", * name="project",
* @SWG\Schema(ref="#/definitions/project") * @SWG\Schema(ref="#/definitions/Project")
* ), * ),
* @SWG\Response( * @SWG\Response(
* response=200, * response=200,
* description="Updated project", * description="Updated project",
* @SWG\Schema(type="object", @SWG\Items(ref="#/definitions/project")) * @SWG\Schema(type="object", @SWG\Items(ref="#/definitions/Project"))
* ), * ),
* @SWG\Response( * @SWG\Response(
* response="default", * response="default",
@ -200,7 +200,7 @@ class ProjectApiController extends BaseAPIController
* @SWG\Response( * @SWG\Response(
* response=200, * response=200,
* description="Deleted project", * description="Deleted project",
* @SWG\Schema(type="object", @SWG\Items(ref="#/definitions/project")) * @SWG\Schema(type="object", @SWG\Items(ref="#/definitions/Project"))
* ), * ),
* @SWG\Response( * @SWG\Response(
* response="default", * response="default",

View File

@ -5,10 +5,18 @@ namespace App\Ninja\Transformers;
use App\Models\Credit; use App\Models\Credit;
/** /**
* Class CreditTransformer. * @SWG\Definition(definition="Credit", required={"client_id"}, @SWG\Xml(name="Credit"))
*/ */
class CreditTransformer extends EntityTransformer class CreditTransformer extends EntityTransformer
{ {
/**
* @SWG\Property(property="id", type="integer", example=1, readOnly=true)
* @SWG\Property(property="amount", type="number", format="float", example=10, readOnly=true)
* @SWG\Property(property="client_id", type="integer", example=1)
* @SWG\Property(property="private_notes", type="string", example="Notes...")
* @SWG\Property(property="public_notes", type="string", example="Notes...")
*/
/** /**
* @param Credit $credit * @param Credit $credit
* *