Hi Girish,

 

It looks like you’re looking to describe a body parameter and not a formData 
one, with an object as a payload.

You can take a look at the online petstore to see samples.

 

 

 

From: <[email protected]> on behalf of Girish Patidar 
<[email protected]>
Reply-To: "[email protected]" 
<[email protected]>
Date: Thursday, 27 April 2017 at 23:47
To: Swagger <[email protected]>
Subject: Post json in swagger api

 

Hello All, 

 

I have integrate swagger-php api with my rest-api in codeigniter,

 

Everything working fine but i got issue in post array in api from swagger-ui.

 

API Swagger code : 

/**

     * @SWG\Post(path="/createbetsnap/get_all_game_data",

     *   tags={"Create Betsnaps Section"},

     *   summary="This function used to get selected tournament schedule date 
and other master data like size, prize structure and entry fee",

     *   description="",

     *   operationId="get_all_game_data",

     *   produces={"application/json"},

     *   consumes={"application/json"},

     *   @SWG\Parameter(

     *     name="Login_Session_Key",

     *     in="header",

     *     description="The Login Session Key of logged in user.",

     *     required=true,

     *     type="string"

     *   ),

     *   @SWG\Parameter(

     *     name="game_tournament",

     *     in="formData",

     *     description="The game tournament id array field.",

     *     required=true,

     *     type="array",

     *     @SWG\Items(type="string")

     *   ),

     *   @SWG\Response(response=200, description="success message with data 
array"),

     *   @SWG\Response(response=500, description="Invalid username/password 
supplied")

     * )

     */

 

I want to post in below format

{"game_tournament":["18","8"]}


but swagger-ui tool post data in 

game_tournament:

8,18


Can you please let me know what wrong with my code.

 

Thanks in Advance

 

 

 

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to