Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

302
Views
Cómo publicar una matriz en swagger api

He integrado swagger php api outr rest-api, todos los servicios funcionan bien, pero tengo un problema en la matriz post json en api. esto no funciona por favor me pueden ayudar.

Aquí mi código api swagger

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

código completo anterior en swagger que agregué antes de mi api.

Quiero publicar el campo game_tournament como

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

Pero desde la publicación del panel swagger-ui en el siguiente formato

 game_tournament=8,18

¿Pueden ayudarme, por favor, qué está mal con mi código, qué necesito cambiar?

Gracias de antemano.

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

usando, por ejemplo, el paquete Swagger Lume para Laravel / Lumen, puede obtener lo que está pidiendo al:

 * @OA\Parameter( * name="game_tournament[]", * in="query", * description="The game tournament ids array field", * required=true, * @OA\Schema(type="array", @OA\Items(type="string")), * ),
about 4 years ago · Santiago Trujillo Report

0

Para publicar datos JSON, debe usar un parámetro in: body y especificar el tipo de datos usando @SWG\Schema :

 * @SWG\Parameter( * name="game_tournament", * in="body", * description="The game tournament ids array field.", * required=true, * @SWG\Schema( * type="array", * @SWG\Items(type="string") * ) * ),
about 4 years ago · Santiago Trujillo Report

0

Solo inténtalo:

 * @SWG\Parameter( * name="game_tournament[]", * type="array", * items="string", * collectionFormat="multi", * required=true, * in="query", * ),
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!