I use Swagger and JMS serializer and show built OpenAPI JSON using NelmioAPIDocBundle https://github.com/nelmio/NelmioApiDocBundle
I have an object with a property, which is an array, that might include several different type of another objects that have their own common properties but one property is different for all of that objects. I do as you can see below and OpeAPI JSON is built, but NelmioAPIDocBundle does not show that model correctly, it shows just NULL instead.
Could you please explain what wrong I do? Is there a way to do what I need?
Thanks in advance!
<?php
use Swagger\Annotations as SWG;
use Nelmio\ApiDocBundle\Annotation\Model;
class A
{
/**
* @SWG\Property(
* type="array",
* @SWG\Items(ref=@SWG\Schema(allOf={
* @SWG\Schema(ref=@Model(type=TypeOne::class)),
* @SWG\Schema(ref=@Model(type=TypeTwo::class)),
* }
* )
* )
* )
*/
protected $objects;
}