0

I am using Symfomy 3.4 with Nelmio API DOC vs 3.

I have a GET API with a multiplier parameter of the format: multiplier[14]=2&multiplier[15]=1. I want to be able to make the request from /api-doc panel with the keys of the array, not only the values. At this moment, I can add only values.

The way I am defining the relationship at this moment is:

     * @SWG\Parameter(
 *     name="multiplier",
 *     in="query",
 *     type="array",
 *     description="multiply the received reward",
 *     @SWG\Items(
 *         type="integer",
 *     ),
 *     required=false
 * )

I tried several things, like

     *     @SWG\Property(
 *          type="string"
 *     ),

but it seems not to work.

How can I make the key appear in the panel so I can complete it there, without using something external, such as Postman?

George Olah
  • 577
  • 5
  • 16
  • 1
    This is not possible - you are using OpenAPI 2.0 which does not support objects in the query string. I think this is not possible in OpenAPI 3.0 (`@OA\...`) either because it supports associative arrays with string keys only, that is `?multiplier[string_key]=value` but not `?multiplier[14]=value`. – Helen Apr 11 '19 at 08:23
  • thank you. great to know I don't have to look any further. – George Olah Apr 11 '19 at 11:47

0 Answers0