Nelmioapidocbundle: In output doesnt show @JMS\VirtualProperty properties.

Created on 16 Jul 2015  路  1Comment  路  Source: nelmio/NelmioApiDocBundle

I have this piece of code

/**
 * @JMS\VirtualProperty
 * @JMS\SerializedName("customerId")
 * @JMS\Groups({"api_triplet"})
 */
public function getCustomerId()
{
    return $this->getCustomer()->getId();
}

And when documentation is generated, customerId doesnt show up in return part of API doc. This is my output annotation part:

 *      output={
 *          "class"="array<Common\ChatBundle\Entity\ChatTriplet>",
 *          "groups"={ "Default", "api_triplet", "customer"}
 *      }

Must mention that in real request response the field is serialized and returned.

Maybe NelmioApiDocBundle ignores @JMS\VirtualProperty???

Most helpful comment

You have to specify a type with the annotation @JMS\Type

>All comments

You have to specify a type with the annotation @JMS\Type

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BafS picture BafS  路  3Comments

timotheemoulin picture timotheemoulin  路  5Comments

alxfv picture alxfv  路  5Comments

andydandy80 picture andydandy80  路  4Comments

manseuk picture manseuk  路  6Comments