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???
You have to specify a type with the annotation @JMS\Type
Most helpful comment
You have to specify a type with the annotation
@JMS\Type