Php NelmioAPI文档:文档中说我的json对象是数组,如何修复?
我正在使用NelmioAPI文档,使用FOSRestBundle和JMSSerializer为我的RESTAPI生成文档。生成的文档说我的json对象实际上是数组。我如何让文档说我的对象是对象 我知道,在php中,这些字段实际上是键值关联数组,但在实际的json中,它们是对象,我希望我的文档能够反映这一点 这是我的密码 实体: 控制器:Php NelmioAPI文档:文档中说我的json对象是数组,如何修复?,php,symfony-2.3,fosrestbundle,jmsserializerbundle,nelmioapidocbundle,Php,Symfony 2.3,Fosrestbundle,Jmsserializerbundle,Nelmioapidocbundle,我正在使用NelmioAPI文档,使用FOSRestBundle和JMSSerializer为我的RESTAPI生成文档。生成的文档说我的json对象实际上是数组。我如何让文档说我的对象是对象 我知道,在php中,这些字段实际上是键值关联数组,但在实际的json中,它们是对象,我希望我的文档能够反映这一点 这是我的密码 实体: 控制器: /** * Resource describing the Facility object * * @ApiDoc( * resource = tr
/**
* Resource describing the Facility object
*
* @ApiDoc(
* resource = true,
* resourceDescription="Operations on facilities.",
* description = "Facility object",
* output = "Company\Bundle\RestApiBundle\Entity\Facility",
* statusCodes = {
* 200 = "Returned when successful",
* 404 = "Returned when the resource is not found"
* }
* )
*
* @param $id
* @return \Symfony\Component\HttpFoundation\Response
*
* @Method("GET")
* @Route("/{id}", name = "api_facility_get")
*/
public function getFacilityAction($id)
{
/**
* Resource describing the Facility object
*
* @ApiDoc(
* resource = true,
* resourceDescription="Operations on facilities.",
* description = "Facility object",
* output = "Company\Bundle\RestApiBundle\Entity\Facility",
* statusCodes = {
* 200 = "Returned when successful",
* 404 = "Returned when the resource is not found"
* }
* )
*
* @param $id
* @return \Symfony\Component\HttpFoundation\Response
*
* @Method("GET")
* @Route("/{id}", name = "api_facility_get")
*/
public function getFacilityAction($id)
{