annotations icon indicating copy to clipboard operation
annotations copied to clipboard

ignores extra closing brackets

Open ivan1986 opened this issue 4 years ago • 0 comments

If the balance of parentheses is violated in the annotation and additional closing parentheses are present, then the parser does not generate an error. In some annotations, this can lead to nesting errors, due to the forgotten closing parenthesis deep in the nested annotations

For example - ObjectResponseDto")) - last bracket move response=400 outsode post, but it's hard to see

     * @OA\Post(path="/cart/api/item/{id}", summary="Update item quantity", tags={"Cart API"},
     *   @OA\Parameter(
     *     name="id",
     *     in="path",
     *     description="itemId",
     *     @OA\Schema(type="string")
     *   ),
     *   @OA\RequestBody(required=true, @OA\JsonContent(type="object",
     *     @OA\Property(property="quantity", description="Quantity", type="number"),
     *   )),
     *   @OA\Response(response=200, description="Item updated successfully",
     *     @OA\JsonContent(type="object", ref="#/components/schemas/ObjectResponseDto"))
     *   ),
     *   @OA\Response(response=400, description="Invalid params"),
     *   @OA\Response(response=404, description="Method not found"),
     * )

I think parser need check brackets balanse and generate error

ivan1986 avatar Jul 23 '21 07:07 ivan1986