Skip to content

JMS Serializer Describer Does Not Respect Default Group #1473

Open
@StefanNiederkofler

Description

@StefanNiederkofler

Hello everyone,

i'm using the jms/serializer-bundle, fos/rest-bundle and the nelmio/api-doc-bundle.

I have a ManyToOne property with a abstract target entity:

/**
 * @var User
 *
 * @ORM\ManyToOne(targetEntity="UserBundle\Entity\User")
 * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
 */
private $author;

The User Entity has a discrimatorMap which connects different User Types.

use JMS\Serializer\Annotation as Serializer;
/**
 * @ORM\Entity(repositoryClass="UserBundle\Entity\UserRepository")
 * @ORM\Table(name="app_user")
 * @ORM\InheritanceType( "SINGLE_TABLE" )
 * @ORM\DiscriminatorColumn( name = "discr", type = "string" )
 * @ORM\DiscriminatorMap({
 *     "person" = "Person",
 *     "student" = "Student",
 *     "partner" = "Partner"
 * })
 * @Serializer\ExclusionPolicy("none")
 */
abstract class User { ...  }

The serializer works, but in the api doc the author property is missing. Everything is marked correctly for the doc. There are other ManyToOne properties too (but not with abstract class) and they are showed correctly in the doc.

Any ideas what am I doing wrong?

Serialized Data, with author:
image

Doc without author property:
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions