Forum Discussion

kj20nt's avatar
kj20nt
Occasional Visitor
14 days ago

Help me solve this error

I am a trainee and I am documenting with Swagger but when I try to run it, I get this error, I work locally

and document as follows, can you please help me

/**

 * @OA\Post(

 *     path="bonusapi/cases/AddUserBonus",

 *     summary="Asignar bono a un usuario",

 *     description="Asignar bono a un usuario",

 *     tags={""},

 *

 *     @OA\Parameter(

 *         name="Players",

 *         in="query",

 *         required=true,

 *         description="Identificador del jugador",

 *         @OA\Schema(type="string")

 *     ),

 *     @OA\Parameter(

 *         name="Deposit",

 *         in="query",

 *         required=true,

 *         description="Identificador del depósito",

 *         @OA\Schema(type="string")

 *     ),

 *     @OA\Parameter(

 *         name="Id",

 *         in="query",

 *         required=true,

 *         description="Identificador del bono",

 *         @OA\Schema(type="string")

 *     ),

 *

 *     @OA\Response(

 *         response=200,

 *         description="Respuesta exitosa",

 *         @OA\JsonContent(

 *             type="object",

 *              @OA\Property(property="HasError", description="Indica si hay un error", type="boolean", example= false),

 *              @OA\Property(property="AlertType", description="Tipo de alerta", type="string", example= "success"),

 *              @OA\Property(property="AlertMessage", description="Mensaje con el error especifico", type="string", example= "Asignación exitosa"),

 *              @OA\Property(property="ModelErrors", description="Errores de modelo", type="Array", example= {}),

 *         )

 *     ),

 *

 *     @OA\Response(

 *         response="500",

 *         description="Respuesta si coincidense es 1 o false",

 *         @OA\JsonContent(

 *             type="object",

 *              @OA\Property(property="HasError", description="Indica si hay un error", type="boolean", example= true),

 *              @OA\Property(property="AlertType", description="Tipo de alerta", type="string", example= "danger"),

 *              @OA\Property(property="AlertMessage", description="Mensaje con el error especifico", type="string", example= "Campos inválidos"),

 *              @OA\Property(property="ModelErrors", description="Errores de modelo", type="Array", example= {}),

 *         )

 *     ),

 *

 *     @OA\Response(

 *         response="501",

 *         description="Respuesta para cualquier excepcion",

 *         @OA\JsonContent(

 *             type="object",

 *              @OA\Property(property="HasError", description="Indica si hay un error", type="boolean", example= true),

 *              @OA\Property(property="AlertType", description="Tipo de alerta", type="string", example= "danger"),

 *              @OA\Property(property="AlertMessage", description="Mensaje con el error especifico", type="string", example= "Error en validaciones o inserciones para adición de bono"),

 *              @OA\Property(property="ModelErrors", description="Errores de modelo", type="Array", example= {}),

 *         )

 *     ),

 *

 *     @OA\Response(

 *         response="502",

 *         description="Error en la asignacion del bono",

 *         @OA\JsonContent(

 *             type="object",

 *              @OA\Property(property="HasError", description="Indica si hay un error", type="boolean", example= true),

 *              @OA\Property(property="AlertType", description="Tipo de alerta", type="string", example= "danger"),

 *              @OA\Property(property="AlertMessage", description="Mensaje con el error especifico", type="string", example= "Asignacion no permitida. Politicas incompatibles"),

 *              @OA\Property(property="ModelErrors", description="Errores de modelo", type="Array", example= {}),

 *         )

 *     ),

 * )

 */

1 Reply

  • Humashankar's avatar
    Humashankar
    Champion Level 0

    Hi kj20nt 

     

    Code undocumented.

    -> This error likely originates from the server you're trying to fetch data from. It suggests that the server encountered an error code that it doesn't have a more explanation for the user

    Type Error Failed to fetch.

    -> This error originates from your client-side code likely JavaScript and indicates that the attempt to fetch data from the server failed.

    This could be due to several reasons:

    - Network

    - Incorrect URL

    -CORS Issues

    -Server Errors

    Hope this helps - Happy to help further!!
    Thank you very much and have a great one!
    Warm regards