Generated XML doc `cref` contains unescaped generic arguments: CS1584 / CS1658 / CS1570 warnings

Ouverte
#2,587 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@reginaldalfret y travaille déjà.

Depuis le 9/10/2026.

  • #2592 par @reginaldalfret — ouverte

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
68/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
aws, csharp
Domaine
backend

Piste de recherche

Start in the Lambda Annotations source that generates handler XML documentation; the issue does not name a file or test, so first locate the generated cref and its tests. Reproduce with a generic handler and GenerateDocumentationFile enabled. Done when the generated XML uses valid generic-argument syntax or omits the cref, and the build produces no XML documentation warnings.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

annotations bug p2 pr/needs-review
Describe the bug

When a [LambdaFunction] method has a generic parameter type the
generated handler's XML doc comment contains a cref with < and > written literally. This is invalid XML doc
syntax and produces warnings on every build with GenerateDocumentationFile enabled. It does not depend on any
namespace clash.

Regression Issue
  • Select this option if this issue appears to be a regression.
Expected Behavior

Generic arguments in a cref are written with braces, e.g.
SqsBatchProcessor{MyPayload, MyHandler}, or the cref is omitted from the generated comment. The generated file
then produces no warnings.

Current Behavior

Incorrect references are generated

/// The generated Lambda function handler for <see cref="Handle(Amazon.Lambda.SQSEvents.SQSEvent, Amazon.Lambda.Core.ILambdaContext, Common.Lambda.Queue.SqsBatchProcessor<Acme.EventDistributor.Trigger.Models.EventBridge.EventBridgePutObject, Acme.EventDistributor.Trigger.EventDistributorTrigger>)"/>
Reproduction Steps

Any handler with a generic parameter, built with <GenerateDocumentationFile>true</GenerateDocumentationFile>:

[LambdaFunction]
public Task<SQSBatchResponse> Handle(SQSEvent evt, ILambdaContext ctx,
    [FromServices] SqsBatchProcessor<MyPayload, MyHandler> processor) => ...
Possible Solution

Generic arguments in a cref are written with braces, e.g. SqsBatchProcessor{MyPayload, MyHandler}

Additional Information/Context

Sample solution

AnnotationsNamespaceClash.zip

AWS .NET SDK and/or Package version used

Amazon.Lambda.Annotations 2.4.1

Targeted .NET Platform

.NET SDK 10.0.401

Operating System and version

Windows 11

Langage dominant
C#
Étoiles
1.7k
Forks
505
Merge moyen
1 j 4 h
PR mergées (30 j)
10

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de aws/aws-lambda-dotnet

Toutes les issues de aws/aws-lambda-dotnet

Issues similaires

Plus d'issues C#

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.