forked from xiongyuxing/tiku-backend.net
24 lines
654 B
C#
24 lines
654 B
C#
using System.Text.Json.Serialization;
|
|
using Tiku.Api.OpenApi;
|
|
|
|
namespace Tiku.Api.Configuration;
|
|
|
|
internal static class ApiPresentationExtensions
|
|
{
|
|
internal static IServiceCollection AddApiPresentation(this IServiceCollection services)
|
|
{
|
|
services.AddControllers()
|
|
.AddJsonOptions(options =>
|
|
{
|
|
options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
|
|
});
|
|
services.AddOpenApi(options =>
|
|
{
|
|
options.AddDocumentTransformer<BearerSecuritySchemeTransformer>();
|
|
});
|
|
services.AddProblemDetails();
|
|
|
|
return services;
|
|
}
|
|
}
|