Skip to content

Commit

Permalink
nswag升级
Browse files Browse the repository at this point in the history
  • Loading branch information
Coldairarrow committed Jan 28, 2024
1 parent 4ee54d9 commit 63a3e42
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion demos/Demo.AspnetCore/Demo.AspnetCore.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>$(DemoNetVersion)</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<NoWarn>CS1591;</NoWarn>
<Nullable>disable</Nullable>
</PropertyGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/Colder.Api.Abstractions/ApiExtentions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ public static IHostBuilder ConfigureWebApiDefaults(this IHostBuilder hostBuilder
options.ApiGroupNames = config.ApiGroupNames;
}
options.SchemaProcessors.Add(new EnumSchemaProcessor());
options.SchemaSettings.SchemaProcessors.Add(new EnumSchemaProcessor());
//解决枚举无法展示问题
options.AllowReferencesWithProperties = true;
options.SchemaSettings.AllowReferencesWithProperties = true;
options.AddSecurity("身份认证Token", Enumerable.Empty<string>(), new OpenApiSecurityScheme()
{
Expand Down Expand Up @@ -186,8 +186,8 @@ public static IApplicationBuilder UseWebApiDefaults(this IApplicationBuilder app

if (apiOption.EnableSwagger)
{
app.UseOpenApi()//添加swagger生成api文档(默认路由文档 /swagger/v1/swagger.json)
.UseSwaggerUi3();//添加Swagger UI到请求管道中(默认路由: /swagger).
app.UseOpenApi(); // serve OpenAPI/Swagger documents
app.UseSwaggerUi(); // serve Swagger UI
}

return app;
Expand Down
2 changes: 1 addition & 1 deletion src/Colder.Api.Abstractions/Colder.Api.Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.11" />
<PackageReference Include="NSwag.AspNetCore" Version="13.18.0" />
<PackageReference Include="NSwag.AspNetCore" Version="14.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 63a3e42

Please sign in to comment.