แก้ปัญหา swagger สร้าง page Error เมื่อใช้งาน WebREportDesigner

**** ยังไม่ได้ เลยเอาออกจากระบบไปก่อน *****
This commit is contained in:
Suphonchai Phoonsawat 2023-08-29 08:40:16 +07:00
parent 9b3efd8981
commit ec3395d970
7 changed files with 52 additions and 55 deletions

View file

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
@ -19,6 +20,9 @@ namespace BMA.EHR.Report.Service
public void Configure(SwaggerGenOptions options)
{
// add swagger document for every API version discovered
foreach (var description in _provider.ApiVersionDescriptions)
{
options.EnableAnnotations();
@ -26,8 +30,9 @@ namespace BMA.EHR.Report.Service
options.SwaggerDoc(
description.GroupName,
CreateVersionInfo(description));
}
}
options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
{
In = ParameterLocation.Header,