Forum Discussion

cgeorge4's avatar
cgeorge4
Regular Visitor
2 years ago

Resolver error "Could not resolve reference: undefined" in Swagger PHP

I’m inputting Swagger PHP notation into our API. When I use schemas I’ve created I'm getting a resolver error "Could not resolve reference: undefined”.

 

When I call my schema I have the JsonContent set in the first response in @OA\JsonContent like this

/**

      *  Update

      *

      * @OA\Put(

      *     path="competitions/{uuid}/teams/{team_id}",

      *     summary="Updating resource in storage.",

      *     description="Updating resource in storage with new information.",

      *     operationId="updateTeam",

      *     tags={"compTeamController"},

      *     security={{"bearer": {}}},

      *     @OA\Response(

      *         response=200,

      *         description="Success",

      *     @OA\JsonContent(

      *         @OA\Property(

      *            property="data",

      *            ref="app/Http/Resource/CompetitionTeamResource"

      *                 ),

      *             )

      *     ),

      *     @OA\Response(

      *      response=403,

      *      description="Access denied to team.",

      *      @OA\JsonContent(

      *              @OA\Property(property="message", type="Access denied to team.")

      *              )

      *      )

      * )

      *     

      */

 

And my schema is set up as

 

/**

     * @OA\Schema(

     *     schema="CompetitionTeamController",

     *     title="Competition Team Controller Model",

     *     description="Competition team controller model",

     *     @OA\Property(

     *          property="id",

     *          title="id",

     *          type="string"

     *     ),

     *      @OA\Property(

     *          property="subid",

     *          title="subid",

     *          type="string"

     *      )

     * )

     */

 

Is there something I can do to fix this error?

No RepliesBe the first to reply