我不想在swagger ui中显示ODataQueryOptions,如何删除它?
我已经尝试为此创建一个新的OperationFilter,但是没有得到任何结果...
public class RemoverODataQueriesOperationFilter : IOperationFilter
{
public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription)
{
foreach (var item in apiDescription.ParameterDescriptions)
{
var odataQuery = operation.parameters.SingleOrDefault(x => x.name == item.Name);
if (odataQuery != null)
operation.parameters.Remove(odataQuery);
}
}
}