I have an API in Symfony Flex, that is documented with use of NelmioApiDocBundle. In Documentation, I want to show, that parentPOSId
parameter can be int or null. How can I do it?
This are my controller annotations:
/**
*
* @FOSRest\Post("/pos/parent")
*
* @SWG\Post(
* tags={"pos_parent"},
* description="set POS parent",
* @SWG\Response(
* response=200,
* description="Parent was set",
* examples={
* "application/json":{
* "POSId":2,
* "parentPOSId": 1
* }
* }
* ),
*
* @SWG\Parameter(
* name="form",
* in="body",
* description="Action parameters",
* @Model(type=App\Domain\Port\POSParent\SetPOSParentInterface::class)
* )
* )
*
*/
This is my model:
namespace App\Domain\Port\POSParent;
interface SetPOSParentInterface
{
public function getPOSId():int;
public function getParentPOSId():?int;
}