0

I have a problem when update nelmio api doc from 3.0 to 3.1/3.3 on my symfony project 4.1. I have no access at the parameters that I can send in my API services in the request, I don't understand. Whether with $ request-> attributes-> all (), $ request-> query-> all () or $ request-> request-> all (), I never have my parameters, but in version 3.0 , it works

I tried clear the cache, change the parameter type, it doesn't works :(

I have this configuration for the nelmio api doc package on my symfony project

nelmio_api_doc:
documentation:
    info:
        title: Project
        description: description
        version: 1.0.0
    securityDefinitions:
       api_key:
           type: apiKey
           description: Json Web Token
           name: Authorization
           in: header
    security:
        - api_key: []
models: { use_jms: true }

And the example annotations in my controller :

@SWG\Parameter(
 *         name="email",
 *         in="formData",
 *         description="The user email",
 *         required=true,
 *         type="string"
 *     ),
 *     @SWG\Parameter(
 *         name="password",
 *         in="formData",
 *         description="The user password",
 *         required=true,
 *         type="string"
 *     ),

Somebody have a solution please ? Thanks !

skyhell
  • 43
  • 7

2 Answers2

1

Can you try this annotation:

/**
 * @SWG\Post(
 *     path="/api/path",
 *     summary="Post to URL",
 *     @SWG\Parameter(
 *          name="body",
 *          in="body",
 *          required=true,
 *          @SWG\Schema(
 *              @SWG\Property(
 *                  property="email",
 *                  type="string"
 *              ),
 *              @SWG\Property(
 *                  property="password",
 *                  type="string"
 *              )
 *          )
 *     )
 *   )
 */
Sadok Mtir
  • 585
  • 6
  • 15
0
 * @Operation(
 *     consumes={"multipart/form-data"},

T tried with this, it works but no access for the put method

skyhell
  • 43
  • 7