1

"nelmio/api-doc-bundle": "^3.6@dev" I need response with model with property product which eque one model Product and property count, but when I use Mode annotation I faced with probem, response model generated like array Product. What I'm doing wrong ?

     * @SWG\Response(
     *     response=200,
     *     description="Json collection object Products",
     *     @SWG\Schema(
     *         type="object",
     *         properties={
     *             @SWG\Property(property="product",
     *                  @Model(type=Product::class, groups={Product::SERIALIZED_GROUP_LIST})),
     *                  @SWG\Property(property="count", type="integer")
     *         }
     *     )
     * )


{
  "product": [
    {
      "id": 0
    }
  ],
  "count": 0
}

I expected result like this:

{
  "product":
    {
      "id": 0
    },
  "count": 0
}
shuba.ivan
  • 3,824
  • 8
  • 49
  • 121

0 Answers0