mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
Address PR feedback: fix EF Core Design version, deprecations, and restore tags
Co-authored-by: collinbarrett <6483057+collinbarrett@users.noreply.github.com>
This commit is contained in:
parent
2cff95da3a
commit
c7f5540771
3 changed files with 46 additions and 30 deletions
|
|
@ -15,10 +15,12 @@ internal static void MapEndpoints(this WebApplication app)
|
|||
app.MapGet("/languages",
|
||||
async (GetLanguages.Query query, CancellationToken ct) => await query.ExecuteAsync(ct))
|
||||
.Produces<List<GetLanguages.Response>>()
|
||||
.WithOpenApi(operation => new OpenApiOperation(operation)
|
||||
.AddOpenApiOperationTransformer((operation, context, ct) =>
|
||||
{
|
||||
Summary = "Gets the languages targeted by the FilterLists.",
|
||||
OperationId = nameof(GetLanguages)
|
||||
operation.Tags = [LanguagesTag];
|
||||
operation.Summary = "Gets the languages targeted by the FilterLists.";
|
||||
operation.OperationId = nameof(GetLanguages);
|
||||
return Task.CompletedTask;
|
||||
})
|
||||
.AddEndpointFilter(DefaultGetCacheFilter)
|
||||
.CacheOutput("ExpireDay");
|
||||
|
|
@ -26,10 +28,12 @@ internal static void MapEndpoints(this WebApplication app)
|
|||
app.MapGet("/licenses",
|
||||
async (GetLicenses.Query query, CancellationToken ct) => await query.ExecuteAsync(ct))
|
||||
.Produces<List<GetLicenses.Response>>()
|
||||
.WithOpenApi(operation => new OpenApiOperation(operation)
|
||||
.AddOpenApiOperationTransformer((operation, context, ct) =>
|
||||
{
|
||||
Summary = "Gets the licenses applied to the FilterLists.",
|
||||
OperationId = nameof(GetLicenses)
|
||||
operation.Tags = [LicensesTag];
|
||||
operation.Summary = "Gets the licenses applied to the FilterLists.";
|
||||
operation.OperationId = nameof(GetLicenses);
|
||||
return Task.CompletedTask;
|
||||
})
|
||||
.AddEndpointFilter(DefaultGetCacheFilter)
|
||||
.CacheOutput("ExpireDay");
|
||||
|
|
@ -37,10 +41,12 @@ internal static void MapEndpoints(this WebApplication app)
|
|||
app.MapGet("/lists",
|
||||
async (GetLists.Query query, CancellationToken ct) => await query.ExecuteAsync(ct))
|
||||
.Produces<List<GetLists.Response>>()
|
||||
.WithOpenApi(operation => new OpenApiOperation(operation)
|
||||
.AddOpenApiOperationTransformer((operation, context, ct) =>
|
||||
{
|
||||
Summary = "Gets the FilterLists.",
|
||||
OperationId = nameof(GetLists)
|
||||
operation.Tags = [FilterListsTag];
|
||||
operation.Summary = "Gets the FilterLists.";
|
||||
operation.OperationId = nameof(GetLists);
|
||||
return Task.CompletedTask;
|
||||
})
|
||||
.AddEndpointFilter(DefaultGetCacheFilter)
|
||||
.CacheOutput("ExpireDay");
|
||||
|
|
@ -56,11 +62,12 @@ internal static void MapEndpoints(this WebApplication app)
|
|||
})
|
||||
.Produces<GetListDetails.Response>()
|
||||
.Produces(StatusCodes.Status404NotFound)
|
||||
.WithOpenApi(operation => new OpenApiOperation(operation)
|
||||
.AddOpenApiOperationTransformer((operation, context, ct) =>
|
||||
{
|
||||
Summary = "Gets the details of the FilterList.",
|
||||
OperationId = nameof(GetListDetails),
|
||||
Parameters =
|
||||
operation.Tags = [FilterListsTag];
|
||||
operation.Summary = "Gets the details of the FilterList.";
|
||||
operation.OperationId = nameof(GetListDetails);
|
||||
operation.Parameters =
|
||||
[
|
||||
new OpenApiParameter
|
||||
{
|
||||
|
|
@ -70,7 +77,8 @@ internal static void MapEndpoints(this WebApplication app)
|
|||
Required = true,
|
||||
Example = JsonValue.Create(1)
|
||||
}
|
||||
]
|
||||
];
|
||||
return Task.CompletedTask;
|
||||
})
|
||||
.AddEndpointFilter(DefaultGetCacheFilter)
|
||||
.CacheOutput("ExpireDay");
|
||||
|
|
@ -78,10 +86,12 @@ internal static void MapEndpoints(this WebApplication app)
|
|||
app.MapGet("/maintainers",
|
||||
async (GetMaintainers.Query query, CancellationToken ct) => await query.ExecuteAsync(ct))
|
||||
.Produces<List<GetMaintainers.Response>>()
|
||||
.WithOpenApi(operation => new OpenApiOperation(operation)
|
||||
.AddOpenApiOperationTransformer((operation, context, ct) =>
|
||||
{
|
||||
Summary = "Gets the maintainers of the FilterLists.",
|
||||
OperationId = nameof(GetMaintainers)
|
||||
operation.Tags = [MaintainersTag];
|
||||
operation.Summary = "Gets the maintainers of the FilterLists.";
|
||||
operation.OperationId = nameof(GetMaintainers);
|
||||
return Task.CompletedTask;
|
||||
})
|
||||
.AddEndpointFilter(DefaultGetCacheFilter)
|
||||
.CacheOutput("ExpireDay");
|
||||
|
|
@ -89,10 +99,12 @@ internal static void MapEndpoints(this WebApplication app)
|
|||
app.MapGet("/software",
|
||||
async (GetSoftware.Query query, CancellationToken ct) => await query.ExecuteAsync(ct))
|
||||
.Produces<List<GetSoftware.Response>>()
|
||||
.WithOpenApi(operation => new OpenApiOperation(operation)
|
||||
.AddOpenApiOperationTransformer((operation, context, ct) =>
|
||||
{
|
||||
Summary = "Gets the software that subscribes to the FilterLists.",
|
||||
OperationId = nameof(GetSoftware)
|
||||
operation.Tags = [SoftwareTag];
|
||||
operation.Summary = "Gets the software that subscribes to the FilterLists.";
|
||||
operation.OperationId = nameof(GetSoftware);
|
||||
return Task.CompletedTask;
|
||||
})
|
||||
.AddEndpointFilter(DefaultGetCacheFilter)
|
||||
.CacheOutput("ExpireDay");
|
||||
|
|
@ -100,10 +112,12 @@ internal static void MapEndpoints(this WebApplication app)
|
|||
app.MapGet("/syntaxes",
|
||||
async (GetSyntaxes.Query query, CancellationToken ct) => await query.ExecuteAsync(ct))
|
||||
.Produces<List<GetSyntaxes.Response>>()
|
||||
.WithOpenApi(operation => new OpenApiOperation(operation)
|
||||
.AddOpenApiOperationTransformer((operation, context, ct) =>
|
||||
{
|
||||
Summary = "Gets the syntaxes of the FilterLists.",
|
||||
OperationId = nameof(GetSyntaxes)
|
||||
operation.Tags = [SyntaxesTag];
|
||||
operation.Summary = "Gets the syntaxes of the FilterLists.";
|
||||
operation.OperationId = nameof(GetSyntaxes);
|
||||
return Task.CompletedTask;
|
||||
})
|
||||
.AddEndpointFilter(DefaultGetCacheFilter)
|
||||
.CacheOutput("ExpireDay");
|
||||
|
|
@ -111,10 +125,12 @@ internal static void MapEndpoints(this WebApplication app)
|
|||
app.MapGet("/tags",
|
||||
async (GetTags.Query query, CancellationToken ct) => await query.ExecuteAsync(ct))
|
||||
.Produces<List<GetTags.Response>>()
|
||||
.WithOpenApi(operation => new OpenApiOperation(operation)
|
||||
.AddOpenApiOperationTransformer((operation, context, ct) =>
|
||||
{
|
||||
Summary = "Gets the tags of the FilterLists.",
|
||||
OperationId = nameof(GetTags)
|
||||
operation.Tags = [TagsTag];
|
||||
operation.Summary = "Gets the tags of the FilterLists.";
|
||||
operation.OperationId = nameof(GetTags);
|
||||
return Task.CompletedTask;
|
||||
})
|
||||
.AddEndpointFilter(DefaultGetCacheFilter)
|
||||
.CacheOutput("ExpireDay");
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0"/>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.22">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
|
|
|||
|
|
@ -89,8 +89,8 @@ internal sealed class TagDescriptionsDocumentFilter : IDocumentFilter
|
|||
{
|
||||
public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
|
||||
{
|
||||
swaggerDoc.Tags = new HashSet<OpenApiTag>
|
||||
{
|
||||
swaggerDoc.Tags =
|
||||
[
|
||||
LanguagesTag,
|
||||
LicensesTag,
|
||||
FilterListsTag,
|
||||
|
|
@ -98,7 +98,7 @@ public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
|
|||
SoftwareTag,
|
||||
SyntaxesTag,
|
||||
TagsTag
|
||||
};
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue