Skip to content

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

Open
@OldrichDlouhy

Description

@OldrichDlouhy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    analyzerIndicates an issue which is related to analyzer experiencearea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions