I am using Swagger v.2 with PHP Annotations and right now I am facing a small issue with "Examples" in request body.
In my controller it looks like this:
/**
* @SWG\Post(
* tags={"pet"},
* path="/pet",
* summary="Create a pet",
* description="Create a pet",
* operationId="CreatePet",
* consumes={"application/json"},
* produces={"application/json"},
* @SWG\Parameter(
* name="pet",
* required=true,
* in="body",
* description="Pet object to be created",
* @SWG\Schema(
* @SWG\Property(property="pet",ref="#/definitions/Pet")
* ),
* @SWG\Example(
* ref="somepath/pet.json"
* )
* )
I need to have different Schema examples depending on certain conditions and that is why I want to have Schema examples stated in a separate json file that would be referenced this way. I got this idea from this link.
However, this does not work and I get The annotation "@Swagger\Annotations\Example" doesn't exist
error.
If anybody knows how it is supposed to be fixed with Annotations, any help would be appreciated.
Thank you