skyhell
skyhell

Reputation: 43

Parameters missing Swagger/api doc

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 !

Upvotes: 0

Views: 2454

Answers (2)

skyhell
skyhell

Reputation: 43

 * @Operation(
 *     consumes={"multipart/form-data"},

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

Upvotes: 0

Sadok Mtir
Sadok Mtir

Reputation: 615

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"
 *              )
 *          )
 *     )
 *   )
 */

Upvotes: 1

Related Questions