This declaration marks DeleteItemRequest
with [Obsolete] attribute it does not bind [Obsolete] attribute to particular route, it’s equal to
[Route("/api/Items/{Id}/Delete", "Delete")]
[Obsolete]
[Route("/api/Items/{Id}", "Delete")]
public class DeleteItemRequest : IReturn<ItemsResponse>
{
public long Id { get; set; }
public string Name { get; set; }
}
If you want to mark operation as Obsolete only for particular route, you should use ApiDeclarationFilter to set Deprecated
property to true
for operation Delete
in the paths with key “/api/Items/{Id}/Delete”
Plugins.Add(new OpenApiFeature
{
ApiDeclarationFilter = (api) => {
api.Paths["/api/Items/{Id}/Delete"].Delete.Deprecated = true;
}
});