dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.

Home Page:https://asp.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ASP0018 analyzer does not respect FormatFilterAttribute for {format} route parameter

OldrichDlouhy opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When route uses parameter {format} and the method is marked with FormatFilterAttribute, the ASP0018 analyzer claims a parameter is unused.

Expected Behavior

The ASP0018 analyzer should not generate the warning

Steps To Reproduce

Having method like this in controller:

    [FormatFilter]
    [HttpGet("items.{format}")]
    public async Task<List<ItemDto>> ExportItems()
    {
       ...
    }

.NET Version

.NET 8

Anything else?

May be related to #54212