Skip to content

ignores extra closing brackets #420

Description

@ivan1986

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions