Files
pgsql-jellyfin/Jellyfin.Server/Filters/ParameterObsoleteFilter.cs
wjones af1152b001 Refactor: standardize namespace and using directive style
Refactored all C# test files to use explicit namespace declarations and moved all using directives inside the namespace block for consistency. Updated assembly info and cache files to reflect the new build. Adjusted MvcTestingAppManifest.json to use fully qualified assembly names. No functional changes; all updates are related to code style, organization, and project metadata.
2026-02-20 16:26:53 -05:00

41 lines
1.3 KiB
C#

// <copyright file="ParameterObsoleteFilter.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Server.Filters
{
using System;
using System.Linq;
using Jellyfin.Api.Attributes;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
/// <summary>
/// Mark parameter as deprecated if it has the <see cref="ParameterObsoleteAttribute"/>.
/// </summary>
public class ParameterObsoleteFilter : IOperationFilter
{
/// <inheritdoc />
public void Apply(OpenApiOperation operation, OperationFilterContext context)
{
foreach (var parameterDescription in context.ApiDescription.ParameterDescriptions)
{
if (parameterDescription
.CustomAttributes()
.OfType<ParameterObsoleteAttribute>()
.Any())
{
foreach (var parameter in operation.Parameters)
{
if (parameter.Name.Equals(parameterDescription.Name, StringComparison.Ordinal))
{
parameter.Deprecated = true;
break;
}
}
}
}
}
}
}